When making API calls to the Dropbox API, each request requires a certain level of authentication. If you’re using an official Dropbox SDK, it will handle these specifics for you. If you’re using the HTTP endpoints however, you’ll need to implement the right authentication type for each endpoint. The documentation for each endpoint indicates which type is used, which will be one of the following:
User Authentication
This is the most common authentication type. This type uses an access token for a specific user and app pair, in order to operate on that user’s account, to the extent allowed by that app’s permission. Applications that authorize only scopes for the User API will receive a user access token.
Example:
curl -X POST "https://api.dropboxapi.com/2/users/get_current_account"
--header "Authorization: Bearer <OAUTH2_ACCESS_TOKEN>"
Team Authentication
This type uses an access token for a specific team and app pair, in order to operate on that team, to the extent allowed by that app’s permissions. Applications that authorize team scopes to use the Business API will receive a team access token.
Example:
curl -X POST "https://api.dropboxapi.com/2/team/get_info"
--header "Authorization: Bearer <OAUTH2_ACCESS_TOKEN>"
Team access tokens can be used for calls requiring User Authentication by including additional HTTP headers. Note that applications using Select-User or Select-Admin headers must have a team_data.member scope applied to the access token. This dependency is enforced in the scoped app’s Permissions page and OAuth flow.
User Authentication via Dropbox-API-Select-User
This type uses an access token for a specific team and app pair in conjunction with a header specifying the target team_member_id, in order to operate on behalf of the team member, to the extent allowed by that app’s permission. All API calls that support User Authentication support this methodology.
Example:
curl -X POST "https://api.dropboxapi.com/2/users/get_current_account" --header "Authorization: Bearer <OAUTH2_ACCESS_TOKEN>" --header "Dropbox-API-Select-User: <TEAM_MEMBER_ID>"