We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
MBUST
3 years agoExplorer | Level 3
When trying to list folder contents, error happens
Hello,
New to Dropbox API.
I can create folders and files, but when I try to list the contents of a folder, I get an error message. I'm particularly interested in getting the contents of...
- 3 years ago
I see you're supplying a folder path and not a shared link and are using app authentication on this /2/files/list_folder call, which can cause this 'path/unsupported_content_type' error.
When using app authentication, that is, with the app key and secret instead of an access token, you do not have access to an account directly. Using app authentication with /2/files/list_folder is instead meant for accessing the contents of a shared link.
So, you would need to either supply ashared_link
on the /2/files/list_folder call, or switch to using user authentication, that is, with an access token for an account.
Greg-DB
Dropbox Community Moderator
2 years agorohitkmk I see Здравко already helpfully offered some guidance here, but if you're still having trouble with this, please feel free to share the relevant code/request that's failing with this error. Please be sure to redact any secret values, such as an app secret or access token though.
rohitkmk
2 years agoExplorer | Level 4
Hi @Greg,
Please find the details of issue I am facing with /2/files/list_folder API.
When I try to fetch the list of folders using this API, I only the list of folders I have created for my Apps (Apps created from Developer console). For e.g.:
But other folders to which I have access in Dropbox (created by other team members or myself), they never appear in the List folder API response.
Should I ask my Team admin to create App in Developer console, use the client id and client secret(for Bearer token generation) of this App to call APIs
so that I can get list of all folders and files created by the Team or do I need to have Administrator role for myself to fetch all these details?
Could you please guide?
- Здравко2 years agoLegendary | Level 20
Yes rohitkmk, by default your user folder could be accessed only. Did you set 'Dropbox-API-Path-Root' header to change this? (your headers stay invisible on the screenshot) If not, try it. 😉
Good luck.
- rohitkmk2 years agoExplorer | Level 4
Hi Здравко, I am using automated connector in a 3rd Party Application which uses these APIs . I cannot add Dropbox-API-Path-Root in request header in the actual connector, so I wanted to check if we use App created by Admin to call this API, would I get to see all folders present in the workspace using list folder API call. Could you please help?
- rohitkmk2 years agoExplorer | Level 4
Hi Здравко,
I am using a 3rd Party Connector which uses this Dropbox APIs. I cannot add Dropbox-API-Path-Root in actual connector. So wanted to check if using App(to generate Bearer Token) created by Administrator work and help in getting list of all folders in workspace?
- rohitkmk2 years agoExplorer | Level 4
Hi Здравко/Greg, I am using a 3rd Party connector which internally uses these APIs, i cannot add Dropbox-API-Path-Root in the connector calls, if I use an App created by Administrator to call the List Folder API, will the API list all the folders in response?
- Здравко2 years agoLegendary | Level 20
rohitkmk wrote:..., if I use an App created by Administrator to call the List Folder API, will the API list all the folders in response?
It doesn't matter who's the owner/creator of the application. What/how the application can access depends on how application authenticates (i.e. on behalves of who is authenticated) and how the calls are performed (i.e. everything that Greg and me already said above). In short - No.
rohitkmk wrote:..., I am using a 3rd Party connector which internally uses these APIs, i cannot add Dropbox-API-Path-Root in the connector calls, ...
Hm... Inform the creators of this connector for mentioned imperfection/bug. In fact this restricts you to access everything outside user private folder on Business account with spaces configuration (in spite you still could be able access old configurations, where no change of the root is need). The connector has to get updated definitely!
Hope this clarifies matter.
- Greg-DB2 years ago
Dropbox Community Moderator
rohitkmk Здравко is correct; to access the team space you'd need to set the 'Dropbox-API-Path-Root' header. (It doesn't matter who owns/creates the app.) You can find more information in the Team Files Guide.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,035 PostsLatest Activity: 4 hours ago
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 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!