Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
i am getting invalid request when i am trying to authorize for my app using following URL:
curl -X POST "https://<APP_KEY>:<APP_SECRET>@api.dropbox.com/1/metadata/link" \ -d link="https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0"
Response:
{
"error_description": "No auth function available for given request",
"error": "invalid_request"
}
Can you please suggest what am i doing wrong here?
i am using SOAPUI tool to validate the request.
Thanks,
Kinjal Panwala
Thanks for the updates, Greg.
Actually, I am trying to access\authenticate data file from DropBox before downloading it & need to do this in javascript.
I can actually download the data files without authentication but looking for a request that autheicates the file with APP Key and Secret provided in URL & then downloads the file..
Let me know if this helps to undestand the requirement.
Thanks,
Kinjal
Do you mean you want to call /1/metadata/link from JavaScript? I just tried that out, and got it to work like this:
$.ajax({ url: 'https://api.dropbox.com/1/metadata/link', type: 'POST', data: {'link': "https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0"}, headers: { "Authorization": "Basic <base64(APP_KEY:APP_SECRET)>" }, success: function(data) { console.log(data); }, error: function(data) { console.error(data); } })
Be sure to replace the <base64(APP_KEY:APP_SECRET)> with your base64 encoded app key and secret, as covered here:
https://www.dropbox.com/developers/reference/auth-types#app
(The technique of putting the app key and secret in the URL doesn't seem to work in JavaScript.)
Also, note that API v1, such as this endpoint, is deprecated:
https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/
You should migrate to API v2:
https://www.dropbox.com/developers
The equivalent endpoint in API v2 is /2/sharing/get_shared_link_metadata. That doesn't support app authentication though.
Using that in JavaScript would look like:
$.ajax({ url: 'https://api.dropboxapi.com/2/sharing/get_shared_link_metadata', type: 'POST', processData: false, data: JSON.stringify({"url": "https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0"}), contentType: 'application/json', headers: { "Authorization": "Bearer <ACCESS_TOKEN>" }, success: function(data) { console.log(data); }, error: function(data) { console.error(data); } })
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!