Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
When I'm trying to fetch short-lived access token I'm getting this error
Can you share the code you're using that produces this error? Based on the error message, it sounds like you're not supplying the "grant_type" parameter when calling the /oauth2/token endpoint. That "grant_type" parameter should be set to either "authorization_code", when exchanging an authorization code for an access token and optionally a refresh token, or "refresh_token" when using a refresh token to get a new short-lived access token.
Hello
Thanks for your reply
I have resolved an error and also get the access token which was needed but that one is not working.
I have used this link token for testing and it's working fine and it it oauth1
https://dropbox.github.io/dropbox-api-v2-explorer/#auth_token/from_oauth1
Access Token : sl.A6K<REDACTED>
I need Oauth2 access token, How to get that token?
Thanks in advance.
The access token you posted, which starts with "sl.", is a Dropbox OAuth 2 access token. Note that you should never post these publicly though, so please refrain from doing so in the future.
The "sl." prefix indicates that this particular access token is a "short-lived" access token, meaning that it was only valid for four hours, after which it can no longer be used to successfully perform Dropbox API calls. When a short-lived access token like this expires, if you need to make further calls, you would need to get a new one. You would do so either by using a refresh token, or by processing the OAuth app authorization flow again. I recommend reading the OAuth Guide and authorization documentation for more information.
Also, the "token/from_oauth1" route in particular you linked to is only meant for use with old OAuth 1 access tokens, retrieved from the old retired Dropbox API v1. If you do not have old OAuth 1 access tokens stored that you need to migrate, you should not use that route. If you are just developing your integration now, you would not have any OAuth 1 access tokens.
Yes I followed the same oauth process and i found the token starting with sl.<token> but i'm getting this error using that token
Server error: `POST https://api.dropboxapi.com/2/files/search_v2` resulted in a `500 Internal Server Error` response: unexpected error occurred
A 500 error like that should indicate an issue on the Dropbox servers. If you're still seeing this issue, please share the code/steps to reproduce that, as well as several sample 'X-Dropbox-Request-Id' response header values. That should help us investigate. (Be sure to redact your access token though.) Thanks!
Here is my code
env('DROPBOX_TOKEN') is access token sl.<access token>
$this->client = new Client(env('DROPBOX_TOKEN'));
$this->adapter = new DropboxAdapter($this->client);
$checkFolderAvailable = $this->client->search('test');
in this search function i'm getting 500 error
Thanks, can you share several sample 'X-Dropbox-Request-Id' response header values though?
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!