cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in learning how media industry leaders use Dropbox Replay? Register for our webinar here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

Dropbox Error: Invalid Access Token, Unable to get Temporary Upload and Download Links

Dropbox Error: Invalid Access Token, Unable to get Temporary Upload and Download Links

kennyroyelphej
New member | Level 2

Greetings,

I have created a web app that allows users to upload and download their documents to Dropbox in the Apps/MY_APP_FOLDER directory. I have their refresh_token and can generate the access_token. While this access token allows access to user details, I am currently unable to generate a temporary upload and download link.

`curl https://api.dropbox.com/oauth2/token \
    -d refresh_token=user_refresh_token \
    -d grant_type=refresh_token \
    -d client_id=app_key \
    -d client_secret=app_secert`

`curl -X POST https://api.dropboxapi.com/2/files/get_temporary_upload_link \
    --header "Authorization: Bearer user_access_token" \
    --header "Content-Type: application/json" \
    --data "{\"commit_info\":{\"autorename\":true,\"mode\":\"add\",\"mute\":false,\"path\":\"/Sample.pdf\",\"strict_conflict\":false},\"duration\":3600}"`

`curl -X POST https://api.dropboxapi.com/2/files/get_temporary_link \
    --header "Authorization: Bearer user_access_token" \
    --header "Content-Type: application/json" \
    --data "{\"path\":\"/Sample.pdf\"}"`

Error:
`{"error":{".tag":"invalid_access_token"},"error_summary":"invalid_access_token/"}`

Could someone please guide me on how to resolve this issue? Any assistance would be greatly appreciated.

References:
1. https://developers.dropbox.com/oauth-guide
2. https://dropbox.tech/developers/using-oauth-2-0-with-offline-access
3. https://www.dropbox.com/developers/documentation/http/documentation#files-get_temporary_upload_link
4. https://www.dropbox.com/developers/documentation/http/documentation#files-get_temporary_link

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20

@kennyroyelphej wrote:

... I have their refresh_token and can generate the access_token. ...

...

Error:
`{"error":{".tag":"invalid_access_token"},"error_summary":"invalid_access_token/"}`

...


Hi @kennyroyelphej,

The error message shows that the access token is not generated as needed or maybe it's not valid anymore (has expired already). Did you organize your token flow/generation/refresh as shown here? 🧐 If not, give it a try and repeat your calls in this context. 😉 Does the same error message appear?

Hope this helps.

View solution in original post

1 Reply 1

Здравко
Legendary | Level 20

@kennyroyelphej wrote:

... I have their refresh_token and can generate the access_token. ...

...

Error:
`{"error":{".tag":"invalid_access_token"},"error_summary":"invalid_access_token/"}`

...


Hi @kennyroyelphej,

The error message shows that the access token is not generated as needed or maybe it's not valid anymore (has expired already). Did you organize your token flow/generation/refresh as shown here? 🧐 If not, give it a try and repeat your calls in this context. 😉 Does the same error message appear?

Hope this helps.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?