cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Get the list of files

Get the list of files

New_Horizons
Explorer | Level 4
Go to solution

Hello!

Sorry for my English.

 

I have a shared link.
I need to get a list of files.

 

I execute the query:

curl -X POST https://api.dropboxapi.com/2/files/list_folder \
    --header "Authorization: Bearer <<my_app_token>>" \
    --header "Content-Type: application/json" \
    --data "{\"path\": \"\",\"shared_link\":\"https://www.dropbox.com/sh/doxhqsfkjtiahkns/AADHM1f9uagbhGLQHgtERCiLcna\",\"recursive\": false,\"include_media_info\": false,\"include_deleted\": false,\"include_has_explicit_shared_members\": false,\"include_mounted_folders\": true}"

Response:

Error in call to API function "files/list_folder": request body: shared_link: expected object, got string

Why? How right?

 

Thank you.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The /2/files/list_folder endpoint expects an object for 'shared_link', with a key 'url' and optionally a key 'password'. So, it should look like this:

curl -X POST https://api.dropboxapi.com/2/files/list_folder \
    --header "Authorization: Bearer <<my_app_token>>" \
    --header "Content-Type: application/json" \
    --data "{\"path\": \"\",\"shared_link\":{\"url\":\"https://www.dropbox.com/sh/doxhqxkjtiahkns/AADHM1f9uaFGLQHgtERCiLcna\"},\"recursive\": false,\"include_media_info\": false,\"include_deleted\": false,\"include_has_explicit_shared_members\": false,\"include_mounted_folders\": true}"

I recommend using the API v2 Explorer to help build these.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

The /2/files/list_folder endpoint expects an object for 'shared_link', with a key 'url' and optionally a key 'password'. So, it should look like this:

curl -X POST https://api.dropboxapi.com/2/files/list_folder \
    --header "Authorization: Bearer <<my_app_token>>" \
    --header "Content-Type: application/json" \
    --data "{\"path\": \"\",\"shared_link\":{\"url\":\"https://www.dropbox.com/sh/doxhqxkjtiahkns/AADHM1f9uaFGLQHgtERCiLcna\"},\"recursive\": false,\"include_media_info\": false,\"include_deleted\": false,\"include_has_explicit_shared_members\": false,\"include_mounted_folders\": true}"

I recommend using the API v2 Explorer to help build these.

New_Horizons
Explorer | Level 4
Go to solution
Everything worked out. Many thanks.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    New_Horizons Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?