Search code examples
dropboxdropbox-api

Business API: sharing_info object not returned for in /files/list_folder


I'm trying to retrieve "share information" of a file that is contained inside user folder in a team space.
Basically, sharing a file using links from the user folder, I would like to understand if a file has been shared or not.
The folder containing the file shared is not shared itself.

The documentation states that:

The access rights of the content is returned within the sharing_info of the file metadata.
[...]
The absence of sharing_info on a file or folder indicates that it is unshared content, accessible only by the user.

I used the followin API to retrieve user file and folder list:

curl -X POST \
  https://api.dropboxapi.com/2/files/list_folder \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -H 'Dropbox-API-Select-User: <user-id>' \
  -d '{"path": "","recursive": true,"include_media_info": false,"include_deleted": false,"include_has_explicit_shared_members": true,"include_mounted_folders": true, "limit":2000}'

The response do not contain sharing_info but inside dropbox the sharing settings are set to link with access to anyone (see picture) picture of a shared file

There is any way to understand, using the files/list_folder API, if a file has been shared using a link? If not, which API should I use to discern this case? Thanks


Solution

  • Unfortunately there isn't a way to retrieve shared links along with the file listing. The sharing_info there is only for the the shared folder kind of sharing, not shared links. I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

    Instead, if you want to retrieve shared links for any particular item, you should use /2/sharing/list_shared_links.