cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Some APIs not working

Some APIs not working

InderjeetSingh
Explorer | Level 4

https://api.dropboxapi.com/2/files/list_folder giving response 

    "error_summary": "path/not_found/..",
 
https://api.dropboxapi.com/2/team/members/list_v2 giving response 
    "error_summary": "missing_scope/"
even when correct scope is provided in app. 
 
https://api.dropboxapi.com/2/users/get_current_account giving different 
root_namespace_id than one is used in code earlier. And if new Dropbox-API-Path-Root used it give error in https://api.dropboxapi.com/2/files/list_folder
    "error_summary": "no_permission/"
 
Why are some of Dropbox APIs not working? All these APIs were working correctly with set values from months.
 
1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff

A "path/not_found" Dropbox API error indicates that the API call failed because there was nothing currently found at the specified path in the connected account under the relevant root. For example, this can happen if there's a mistake or typo in the path value the app supplies, if the file/folder has been renamed, moved, or deleted from that path, if the app is not connected to the correct account for that particular path, etc.

 

When specifying the path, make sure you provide the full and accurate path for the desired file under the relevant root. For example, if you have a file named "example.csv" inside a folder named "folder", the path would be "/folder/example.csv". You can find more information on path formats here.

 

Here are several things you can check in particular to debug this:

 

  • Make sure you're using a currently accurate path value: You can use /2/files/list_folder and /2/files/list_folder/continue to list the contents of a folder so you can check what the correct path values would be for items in those folder(s). To list the root, set path to the empty string "" when calling /2/files/list_folder. You can use the path_lower or id values returned for the files/folders in that folder to interact with those files/folders.

 

  • Make sure you're connected to the correct account for the path value you're using: You can use /2/users/get_current_account to check which account the app is connected to.

 

  • Make sure you're using app folder-relative paths, if your app is registered for the "app folder" access type: Apps with the "app folder" access type can only access the contents of the special app folder that gets automatically created for it. If your app has the "app folder" access type, then it will only be able to access files in the app folder, and the root for any path value supplied by that app will automatically be the app folder root. You can find more information on app permissions here. For example, If your app has the app folder access type and you're trying to access something you can see on the Dropbox web site at "/Apps/<app folder name>/folder/example.csv", you should only send the path value as "/folder/example.csv".

 

  • Make sure you're accessing the relevant root: When using an app with the "full Dropbox" access type, API calls default to the member folder, but if you're trying to access the "team space" (only applicable to members of a team with a "team space" configuration), you'll need to configure that as the root explicitly, as covered in the Team Files Guide. It sounds like your team recently migrated to the updated team space configuration, so this one is likely the cause.

 

A 'missing_scope' error indicates that while the app is permitted to use that scope, the particular access token you're using to make the API call does not have that scope granted. Also, be aware that just adding a scope to your app via the App Console does not retroactively grant that scope to existing access tokens or refresh tokens. That being the case, to make any API calls that require that scope, you'll need to re-authorize the app to get a new access token (and refresh token, if being used) with that scope. Refer to the OAuth Guide and authorization documentation for more information.

 

Note that the root_namespace_id returned by /2/users/get_current_account can change in some cases, so it's always best to retrieve the current value when needed.

 

A no_permission error can indicate that the account for the access token does not have permission to access to that particular namespace. You can find more information in the Path Root Header Modes documentation here. Note that permissions can change over time, e.g., due to team or sharing setting changes. As a best practice, apps should be written to programmatically catch and handle errors like this, in order to manage these changes. If there's been a change to your team and/or permissions, you may need to check your configuration and update the namespace ID you're using accordingly to perform the calls needed for your use case.
 
For more information on interacting with team content via the API, please refer to the Team Files Guide as well as this post for information on how to handle the updated team space configuration.

View solution in original post

5 Replies 5

Greg-DB
Dropbox Staff

A "path/not_found" Dropbox API error indicates that the API call failed because there was nothing currently found at the specified path in the connected account under the relevant root. For example, this can happen if there's a mistake or typo in the path value the app supplies, if the file/folder has been renamed, moved, or deleted from that path, if the app is not connected to the correct account for that particular path, etc.

 

When specifying the path, make sure you provide the full and accurate path for the desired file under the relevant root. For example, if you have a file named "example.csv" inside a folder named "folder", the path would be "/folder/example.csv". You can find more information on path formats here.

 

Here are several things you can check in particular to debug this:

 

  • Make sure you're using a currently accurate path value: You can use /2/files/list_folder and /2/files/list_folder/continue to list the contents of a folder so you can check what the correct path values would be for items in those folder(s). To list the root, set path to the empty string "" when calling /2/files/list_folder. You can use the path_lower or id values returned for the files/folders in that folder to interact with those files/folders.

 

  • Make sure you're connected to the correct account for the path value you're using: You can use /2/users/get_current_account to check which account the app is connected to.

 

  • Make sure you're using app folder-relative paths, if your app is registered for the "app folder" access type: Apps with the "app folder" access type can only access the contents of the special app folder that gets automatically created for it. If your app has the "app folder" access type, then it will only be able to access files in the app folder, and the root for any path value supplied by that app will automatically be the app folder root. You can find more information on app permissions here. For example, If your app has the app folder access type and you're trying to access something you can see on the Dropbox web site at "/Apps/<app folder name>/folder/example.csv", you should only send the path value as "/folder/example.csv".

 

  • Make sure you're accessing the relevant root: When using an app with the "full Dropbox" access type, API calls default to the member folder, but if you're trying to access the "team space" (only applicable to members of a team with a "team space" configuration), you'll need to configure that as the root explicitly, as covered in the Team Files Guide. It sounds like your team recently migrated to the updated team space configuration, so this one is likely the cause.

 

A 'missing_scope' error indicates that while the app is permitted to use that scope, the particular access token you're using to make the API call does not have that scope granted. Also, be aware that just adding a scope to your app via the App Console does not retroactively grant that scope to existing access tokens or refresh tokens. That being the case, to make any API calls that require that scope, you'll need to re-authorize the app to get a new access token (and refresh token, if being used) with that scope. Refer to the OAuth Guide and authorization documentation for more information.

 

Note that the root_namespace_id returned by /2/users/get_current_account can change in some cases, so it's always best to retrieve the current value when needed.

 

A no_permission error can indicate that the account for the access token does not have permission to access to that particular namespace. You can find more information in the Path Root Header Modes documentation here. Note that permissions can change over time, e.g., due to team or sharing setting changes. As a best practice, apps should be written to programmatically catch and handle errors like this, in order to manage these changes. If there's been a change to your team and/or permissions, you may need to check your configuration and update the namespace ID you're using accordingly to perform the calls needed for your use case.
 
For more information on interacting with team content via the API, please refer to the Team Files Guide as well as this post for information on how to handle the updated team space configuration.

InderjeetSingh
Explorer | Level 4

I have tried your API to check which account the app is connected to https://api.dropboxapi.com/2/users/get_account and there is response 

    "error_summary": "no_account/.",
 
It was working correctly earlier and suddenly these issues coming. 

Greg-DB
Dropbox Staff

To check which account the app is connected to, you should use /2/users/get_current_account (not /2/users/get_account).

InderjeetSingh
Explorer | Level 4

In my case Dropbox app was created under my email account and admin changed my access from 'admin' to 'member', so software suddenly started giving me 'no permissions' error even when app had all scopes.

Greg-DB
Dropbox Staff

A "no_permission" error isn't a scope error. A "no_permission" error would be more related to your file/folder permissions instead.

 

To clarify, do you still require help with this error? If so, please share:

  • the steps to reproduce the issue, including relevant code snippet(s) and parameter value(s), but don't include any access or refresh token(s)
  • the full text of any error or unexpected output
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    InderjeetSingh Explorer | Level 4
What do Dropbox user levels mean?