Add the power of the Box AI API to your custom apps at Content Cloud Summit on May 15

Learn more and register!

アプリケーションフロー

アプリケーションフロー

一般的に、アプリケーションでは以下のようにサービス利用規約を使用します。

ユーザーとして認証されたアプリケーションが、関連するサービス利用規約にユーザーが同意している必要があるBox内の項目にアクセスしようとすると、TERMS_OF_SERVICE_REQUIREDエラーが返されます。

{
    "type": "error",
    "status": 400,
    "code": "terms_of_service_required",
    "context_info": {
        "tos_id": 261346614,
        "tos_user_status_id": 4562456
    },
    "help_url": "https://developer.box.com/guides/api-calls/permissions-and-errors/common-errors/",
    "message": "User must accept custom terms of service before action can be taken",
    "request_id": "ADF7722DD"
}

アプリケーションは、GET /terms_of_services/:idを呼び出してサービス利用規約の情報をリクエストします。

{
  "id": 261346614,
  "type": "terms_of_service",
  "status": "enabled",
  "enterprise": {
    "id": 11446498,
    "type": "enterprise",
    "name": "Acme Inc."
  },
  "tos_type": "managed",
  "text": "By using this service, you agree to ...",
  "created_at": "2012-12-12T10:53:43-08:00",
  "modified_at": "2012-12-12T10:53:43-08:00"
}

その後、アプリケーションはサービス利用規約のテキストをユーザーに表示できます。

ユーザーが利用規約を同意または拒否すると、最初のエラーによってレスポンスでtos_user_status_idが返されたかどうかに応じて、PUT /terms_of_service_user_statuses/:idまたはPOST /terms_of_service_user_statusesが呼び出されます。