cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right 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: 

Getting a list of files using HTTP API in shell with Curl

Getting a list of files using HTTP API in shell with Curl

Mark L.45
Collaborator | Level 9

I run this and get empty response, despite having created a /Homework/math


curl -X POST https://api.dropboxapi.com/2/files/list_folder \ --header "Authorization: Basic <token>" \ --header "Content-Type: application/json" \ --data "{\"include_deleted\":false,\"include_has_explicit_shared_members\":false,\"include_media_info\":false,\"include_mounted_folders\":true,\"include_non_downloadable_files\":true,\"path\":\"/Homework/math\",\"recursive\":false}"

And I get the response

{"error_summary": "path/unsupported_content_type/.", "error": {".tag": "path", "path": {".tag": "unsupported_content_type"}}}%

 

All I am trying to do is get a list of files? I don't want to preview it, just a list??

 

Under /Homework/math under this application called "ArduinoCloud" I stored two images and a text file, nothing more.

 

0 Accepted Solutions
3 Replies 3

Здравко
Legendary | Level 20

Hi @Mark L.45,

You just found out undocumented error message. 🤫 One more documentation bug that the staff responsible for documentation need to fix. Even more: you got confuse by other documentation imperfection - in /2/files/list_folder example Basic authentication is used incorrectly! 😁 Somebody has fallen asleep while typed this (probably late party - who knows).

Basic authentication may be used while accessing something that doesn't require direct account access - listing Dropbox link pointing a folder for instance. In all other cases you need Bearer authentication! 😉

Hope this helps.

 

PS: By the way, Basic authentication doesn't use any token, but a username and password mapped to app key and app secret. Bearer authentication uses access token.

Mark L.45
Collaborator | Level 9

I just replied, but ... so I will again...your right you need Bearer Authentication, not Basic Authentication for this to work.

Greg-DB
Dropbox Staff

[Cross-linking for reference: https://stackoverflow.com/questions/79014393/list-dropbox-files-through-their-api-using-curl ]

 

That's correct, you'll need Bearer auth for this. I'll ask the team to fix this up in the documentation. Thanks!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Mark L.45 Collaborator | Level 9
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?