cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I revoke Dropbox business access token?

How can I revoke Dropbox business access token?

harutofujihara
Helpful | Level 6

I want to use "revoke token api" to revoke business account's access token.

I referenced dropbox api document, and tried to use this api.

https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke 

 

But I received 400 error and following message. (I use Laravel and Guzzle for Http client)

 

I cannot understand the error message  "This API function operates on a single Dropbox account, but the OAuth (truncated...)" .

Could you please explain me what this message mean and how can I solve it?

 

[2020-11-17 08:38:24] local.ERROR: Client error: `POST https://api.dropboxapi.com/2/auth/token/revoke` resulted in a `400 Bad Request` response:
Error in call to API function "auth/token/revoke": This API function operates on a single Dropbox account, but the OAuth (truncated...)
 {"exception":"[object] (GuzzleHttp\\Exception\\ClientException(code: 400): Client error: `POST https://api.dropboxapi.com/2/auth/token/revoke` resulted in a `400 Bad Request` response:
Error in call to API function \"auth/token/revoke\": This API function operates on a single Dropbox account, but the OAuth (truncated...)
 at /var/www/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113)
4 Replies 4

Greg-DB
Dropbox Staff

It looks like your client is truncating the error message. I recommend configuring it to show the whole message, if possible.

 

For reference though, it would read:

Error in call to API function "auth/token/revoke": This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team. Since your API app key has team member file access permissions, you can operate on a team member's Dropbox by providing the "Dropbox-API-Select-User" HTTP header or "select_user" URL parameter to specify the exact user <https://www.dropbox.com/developers/documentation/http/teams>.

That is, since the /2/auth/token/revoke endpoint happens to be a "user-linked" endpoint, you need to specify a particular user account when calling it, by including a "Dropbox-API-Select-User" header with the member ID of a team member. You can find more information here under "Member file access".

 

harutofujihara
Helpful | Level 6

Thank you! I should have configured it to show the whole message.

Maybe I can solve it with you helpful advice.

Pratik2
New member | Level 2

What permissions should the app have to run this API? I tried running it by providing the respective header and it says that my app does not have enough permissions. Can you please help?

DB-Des
Dropbox Engineer

@Pratik2 

 

The endpoint /token/revoke does not require any specific scopes. In order to better assist, could you provide us with the exact error message you are receiving from the API?

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    DB-Des Dropbox Engineer
  • User avatar
    Pratik2 New member | Level 2
  • User avatar
    harutofujihara Helpful | Level 6
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?