cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Re: Invalid_request: No auth function available for given request

Invalid_request: No auth function available for given request

kpanwala
New member | Level 2

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

3 Replies 3

Greg-DB
Dropbox Staff
Hi Kinjal, the curl code you posted works for me when I put in an app key and secret.

It sounds like the tool you're using isn't producing a valid request. Note that the Dropbox API isn't a SOAP API though, so that tool may not work for it.

Can you share the actual request it's producing?

kpanwala
New 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 Staff

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);
    }
})  

 

Need more support?