TERMS_OF_SERVICE_REQUIRED error.
tos_user_status_id in the response.
Server authentication and acting on behalf of users
Applications using JWT, Client Credentials Grant (CCG), or OAuth 2.0 may act as a , an , or a managed user. Terms of Service enforcement depends on which user is in context for the API request.| Scenario | Blocked if Managed Terms of Service not accepted? |
|---|---|
API call with a service account or App User token (no As-User) | No — headless users are exempt |
| API call with CCG/JWT and set to a managed user | Yes — the user specified in the As-User header must have accepted |
| User access token issued for a managed user | Yes — token issuance is blocked until Terms of Service is accepted |
| OAuth authorization code flow for a managed user | Yes — authorization is blocked until Terms of Service is accepted |
API call with As-User set to a service account or App User | No — headless users are exempt |
Accepting Terms of Service programmatically
When a managed user has not accepted Managed Terms of Service, most API calls made on their behalf returnterms_of_service_required. To resolve this
without requiring the user to sign in to the Box web application:
- Obtain a server authentication access token (JWT or CCG).
- Set the header to the managed user’s ID so subsequent requests run in that user’s context.
- Call the Terms of Service endpoints, which remain available even when Terms
of Service acceptance is outstanding:
- to retrieve the terms text
- or to accept or reject
- Retry the original API call.
As-User header to act as that user. Acceptance must be recorded for the
user who is subject to the Terms of Service.