We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
kpanwala
9 years agoNew member | Level 2
Invalid_request: No auth function available for given request
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:...
kpanwala
9 years agoNew member | Level 2
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
Greg-DB
Dropbox Community Moderator
9 years agoDo 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);
}
})
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!