简体   繁体   English

Dropbox-如何检索文件夹的内容

[英]Dropbox - How to retrieve the content of a folder

I want to get a JSON that describes the content of the folder. 我想获取一个描述文件夹内容的JSON。 Dropbox API Metadata says I only need the following link address and the path to my public folder Dropbox API元数据说,我只需要以下链接地址和公共文件夹的路径

a) LINK to Metadata + path to my folder a)链接到元数据+我文件夹的路径

https://api.dropbox.com/1/metadata/auto/<path>

b) Path to my folder b)我的文件夹的路径

https://www.dropbox.com/sh/2w...........73z4na?dl=0

if I cobined a) and b) in the browserbar I always get an ERROR: 如果我在浏览器栏中合并了a)和b),则总是会收到错误消息:

{"error": "No auth method found."}

How is it done correctly? 如何正确完成?

The /metadata Dropbox API endpoint takes path parameter, which should be the relative path to the desired file or folder inside a user's Dropbox account. / metadata Dropbox API端点采用path参数,该参数应该是用户Dropbox帐户中所需文件或文件夹的相对路径。 For example, this may look like "/Documents/Resume.docx". 例如,它可能看起来像“ /Documents/Resume.docx”。 Your sample is a shared link though, which doesn't contain the necessary path. 不过,您的示例是一个共享链接,其中不包含必要的路径。

In addition, the /metadata Dropbox API endpoint is part of the Dropbox Core API, which requires the user to first authorize a Dropbox API app to access their account. 此外, / metadata Dropbox API端点是Dropbox Core API的一部分,该终结点要求用户首先授权Dropbox API应用访问其帐户。 As you don't have that part done, you get that auth error. 由于您没有完成该部分,因此会收到auth错误。

You should work through the instructions and tutorial for whatever SDK or library you're trying to use, if any. 对于您要使用的任何SDK或库(如果有),您都应按照说明和教程进行操作。 There's also an OAuth guide for the Dropbox API that should be helpful: 还有一个针对Dropbox API的OAuth指南,应该会有所帮助:

https://www.dropbox.com/developers/reference/oauthguide https://www.dropbox.com/developers/reference/oauthguide

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM