Dropbox filesListFolder 表示我的路径无效。

huangapple go评论72阅读模式
英文:

Dropbox filesListFolder says my path is invalid

问题

我正在使用Dropbox的Javascript SDK调用`dropbox.filesListFolder({ path: 'apps/my_app' })`,但Dropbox返回400错误

```js
在调用API函数“files/list_folder”时出错:
请求主体:路径:'apps/my_app'与模式不匹配
'(/(.|[\r\n])*)?|id:.*|(ns:[0-9]+(/.*)?)'

我已检查我的应用程序具有正确的权限,在API网站上生成了一个用于测试的令牌,并在Dropbox应用程序中检查了我的帐户中是否存在该文件夹。

我还尝试了路径Apps/my_appmy_app

使用反斜杠如apps\my_appapps\\my_appapps\\\my_app也不起作用。

请问还有什么其他方法可以尝试?


<details>
<summary>英文:</summary>

I&#39;m using the Dropbox Javascript SDK to call `dropbox.filesListFolder({ path: &#39;apps/my_app&#39; })` and Dropbox returns the 400 error 

```js
Error in call to API function \&quot;files/list_folder\&quot;: 
request body: path: &#39;apps/my_app&#39; did not match pattern 
&#39;(/(.|[\\r\\n])*)?|id:.*|(ns:[0-9]+(/.*)?)&#39;

I've checked that my app has the correct permissions, generated a token on the API website to test with, and checked the folder exists in my account in the Dropbox app.

I've also tried the paths Apps/my_app, my_app.

Using backslashes like apps\my_app or apps\\my_app or apps\\\my_app doesn't work either.

What else can I try please?

答案1

得分: 1

除了根目录本身(即空字符串""),Dropbox API 路径应以斜杠"/"开头。因此,对于你的示例,你应该提供"/apps/my_app"

另外,请注意,如果你的应用程序具有“应用文件夹”访问类型,那么你的路径将自动相对于应用文件夹本身进行解释,因此你不需要包括"/apps/my_app"部分。也就是说,在这种情况下,要列出应用文件夹本身的根目录,你只需提供"",或者要列出应用文件夹内名为“subfoldername”的某个文件夹,你应该提供"/subfoldername"

英文:

Other than for the root itself (which would be just the empty string &quot;&quot;), Dropbox API paths should start with a "/". So for your example, you would supply &quot;/apps/my_app&quot;.

Also, note that if your app has the "app folder" access type, your paths will automatically be interpreted relative to the app folder itself, so you wouldn't include the &quot;/apps/my_app&quot; portion. That is, in that case to list the root of the app folder itself, you would just supply &quot;&quot;, or to list some folder, for example named "subfoldername" inside the app folder, you would supply &quot;/subfoldername&quot;.

huangapple
  • 本文由 发表于 2023年4月6日 20:42:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949657.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定