首页 > 解决方案 > 业务 API:/files/list_folder 中未返回 shared_info 对象

问题描述

我正在尝试检索包含在团队空间的用户文件夹中的文件的“共享信息”。
基本上,使用用户文件夹中的链接共享文件,我想了解文件是否已共享。
包含共享文件的文件夹本身不共享。

该文件指出:

内容的访问权限在文件元数据的sharing_info 中返回。
[...]
文件或文件夹上没有sharing_info 表明它是非共享内容,只能由用户访问。

我使用以下 API 来检索用户文件和文件夹列表:

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}'

响应不包含sharing_info,但在保管箱内,共享设置被设置为链接到任何人的访问权限(见图) 共享文件的图片

有什么方法可以使用files/list_folder API 来理​​解文件是否已使用链接共享?如果不是,我应该使用哪个 API 来辨别这种情况?谢谢

标签: dropboxdropbox-api

解决方案


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.


推荐阅读