Learn how to make the most out of the Dropbox Community here 💙.
Learn how to make the most out of the Dropbox Community here 💙.
I'm not sure what you mean when you say you are "not getting any type of response from the curl command". For reference, if you need to debug something with curl, you can use the "-v" flag to enable verbose mode.
In any case, I haven't tested your new code, but the parameters look right. I also don't see where you retrieve the access token from the new /oauth2/token call, but assuming you do either manually or in code not shown, it seems right. Does it work for you when you run it?
So I used this code to upload files. I tried using the refresh token and it doesn't work...
Access tokens and refresh tokens are different objects and are not interchangeable, so you can't use a refresh token as an access token like that. Instead, whenever you need a new short-lived access token you should call /oauth2/token with grant_type=refresh_token and refresh_token set to the refresh token, like in step 5 of this example. That call will return a new short-lived access token which you can then use to make further API calls, such as /2/files/upload.
Is this correct? If so, I'm not getting any type of response from the curl command
I'm not sure what you mean when you say you are "not getting any type of response from the curl command". For reference, if you need to debug something with curl, you can use the "-v" flag to enable verbose mode.
In any case, I haven't tested your new code, but the parameters look right. I also don't see where you retrieve the access token from the new /oauth2/token call, but assuming you do either manually or in code not shown, it seems right. Does it work for you when you run it?
Thanks Greg! I think I figured it out. I'm going to post code for future users with this problem.
This is the full code to get the refresh token. Replace the variables at the top where it cays CLIENTIDHERE and CLIENTSECRETHERE. Also the auth_url has a space where you have to put the CLIENTID
Once you run it, a web browser will pop up and you'll need to copy the code on the right side of the URL that pops up. This is your authorization_code that you'll have to enter in the prompt. Once you enter in the authorization code, it will give you a refresh token:
If you need more help you can view your support options (expected response time for an email or 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!