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