Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I have an app that used to run fine on the v1 API using xmlhttp requests. Migrating the app to v2 I can't get anything except authorization to work. The app has read/write access to its own folder only.
For example: I want to get a list of the files/folders in a folder named "Recipes" in my app folder:
I create an xmlhttp request (Browser based javascript) with
method: "POST",
url: "https://api.dropbox.com/2/files/get_metadata",
Request header: "Content-Type: "application/json",
and the posted data body is a javascript string:
{"path":"/Recipes"}
I always get a 409 error with "/path/not found" even though I can see the folder clearly in my Dropbox app.
If I try to get the file/folder list of my app's folder I get a 400 error with the message "the root folder is not supported."
You mentioned your app has an app folder, so can you double check that the app folder itself contains a "Recipes" folder in it? I.e., when you look at dropbox.com, that would be at /Apps/<app folder name/Recipes. Also, if you've registered multiple apps or used multiple accounts, make sure you're using an access token for the right app and account.
In any case, to list the contents of a folder, including root (which is the app folder for apps with the app folder permission) you should use the /2/files/list_folder and /2/files/list_folder/continue methods.
You mentioned your app has an app folder, so can you double check that the app folder itself contains a "Recipes" folder in it? I.e., when you look at dropbox.com, that would be at /Apps/<app folder name/Recipes. Also, if you've registered multiple apps or used multiple accounts, make sure you're using an access token for the right app and account.
In any case, to list the contents of a folder, including root (which is the app folder for apps with the app folder permission) you should use the /2/files/list_folder and /2/files/list_folder/continue methods.
Thanks! I can't seem to reproduce that issue though. This works correctly for me:
$.ajax({ url: 'https://api.dropboxapi.com/2/files/get_metadata', type: 'POST', processData: false, data: JSON.stringify({"path": "/Recipes"}), contentType: 'application/json', headers: { "Authorization": "Bearer <APP FOLDER ACCESS TOKEN>" }, success: function(data) { console.log(data); }, error: function(data) { console.error(data); } Object {.tag: "folder", name: "Recipes", path_lower: "/recipes", path_display: "/Recipes", id: "id:JmcDh3CS6tAAAAAAAAABCg"}
Please feel free to open an API ticket showing the account and app folder with the Recipes folder, and the API call request/response with the unexpected result and we'll be happy to look into it specifically for you.
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!