dropbox - 业务 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 来辨别这种情况?谢谢
解决方案
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.
推荐阅读
- charts - 如何分隔谷歌图表面积图中的日期
- mongodb - 过滤器键不在集合中
- python - Python 上的循环导入
- android - Android Studio:当我尝试添加 RecyclerView 时显示一个警告框
- scala - 如何在不使用 SQL 插入的情况下向 Scala 中的 DataFrame 添加/追加新行?
- android - 如何将数据从后台 android 服务传递到 react-native
- java - 在 Java 中实现枚举时的最佳实践是什么?
- python - 使用 Selenium 仅通过其 XPath 的一部分查找元素
- amazon-web-services - Amazon RDS 实例被自动删除
- azure-devops - 术语“Get-AzureRmPolicyDefinition”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称