cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App 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: 

Re: 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?