cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Questions about Dropbox? The average community response time is 4 hours! Ask a question now
Highlighted
Level 3

Eroor 400 when using the Dropbox choose API

Hi,

I am trying to consume the Dropbox choose API as from the below link:

https://www.dropbox.com/developers/chooser

However, when the chooser window is shown, it ends up with error 400.

400 error for chooser API.png

 

Kindly advise on what went wrong. 

7 Replies
Dropboxer

Re: Eroor 400 when using the Dropbox choose API

[Cross-linking for reference: https://stackoverflow.com/questions/52756880/error-400-while-using-dropbox-chooser-api ]

Can you share the full URL of that page that's showing the 400 error? That would help us look into this. Thanks in advance! 

Reply
Loading...
Level 3

Re: Eroor 400 when using the Dropbox choose API

Hi

I'm getting the same error, and here is the full URL 
https://www.dropbox.com/chooser?origin=https%3A%2F%2Fhttp://a9b7088a.ngrok.io&app_key=0ro4ue0jd0uqghq&link_type=preview&trigger=button&multiselect=false&extensions=&folderselect=false&iframe=false&version=2

Reply
Loading...
Dropboxer

Re: Eroor 400 when using the Dropbox choose API

@dropbox-newbie It looks like the issue is that you don't have the domain you're running from pre-registered as a Dropbox Chooser/Saver domain on the app's page on the App Console. You need to pre-register the domain(s) you'll be using your app key on so that other people can't use your app key on their own sites.

In this case, you'd want to register 'a9b7088a.ngrok.io'. To do so, go to the App Console, click on the app with app key '0ro4ue0jd0uqghq', and enter 'a9b7088a.ngrok.io' under "Chooser/Saver domains".

Reply
Loading...
Level 3

Re: Eroor 400 when using the Dropbox choose API

Greg,

Here is the URL 

https://www.dropbox.com/chooser?origin=https%3A%2F%2Fd0aapangw01.hrpsdev.local%3A44303&app_key=vpukr...

One more thing, currently I have embedded the code from the below link locally onto my application(Is it ok to do that?). We wouldn't be using HTML to embed the script. 

https://www.dropbox.com/static/api/2/dropins.js

 Hence is there any other way to pass the app key. 

Reply
Loading...
Dropboxer

Re: Eroor 400 when using the Dropbox choose API

@jasskcet That URL isn't currently returning a 400 for me, so it sounds like you already managed to get that sorted out. (E.g., by registering the domain, like in my last comment.)

Also, we don't recommend copying and embedding your own copy of dropins.js, as then you won't get any updates we make to it.

Finally, it is technically possible to set the app key programmatically like this:

Dropbox.appKey = "APP_KEY";

That's not documented though, so it shouldn't be considered officially supported.

 

Reply
Loading...
Level 3

Re: Eroor 400 when using the Dropbox choose API

dropboxChooserDomains.pngThanks for the reply @Greg . I actually do have the server domain specified.

Reply
Loading...
Dropboxer

Re: Eroor 400 when using the Dropbox choose API

@dropbox-newbie Taking a closer look at the sample URL you shared, I see your 'origin' value is actually "https%3A%2F%2Fhttp://a9b7088a.ngrok.io", which decodes to "https://http://a9b7088a.ngrok.io".

That's not valid, as it contains two protocols (both "https://" and "http://") for some reason. Can you check that you have a valid URL with just one protocol for the page where you're hosting your Chooser integration?

Reply
Loading...
END WEBSITE FEEDBACK SNIPPET-->