Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

awb's avatar
awb
Helpful | Level 7
2 years ago
Solved

The remote server returned an error: (422) Unprocessable Entity.

I'm trying to list all the file and folders in a Dropbox Teamspace and getting the following error

The remote server returned an error: (422) Unprocessable Entity.

 

"{"error":{".tag":"invalid_root","invalid_root":{".tag":"team","home_namespace_id":"retracted","home_path":"/retracted Dropbox Team Spaces","root_namespace_id":"retracted"}},"error_summary":"invalid_root/"}"

 

This all looked to be working as expected until a few weeks ago.

If anyone could help it would be much appreciated

 

  • Hello awb ,

    Based on the error message "invalid_root", this is occurring as the Dropbox-API-Path-Root header "root_namespace_id" value is incorrect. Please cross check if you are using the correct "root_namespace_id" by executing the 2/users/get_current_account endpoint. You can also test the endpoint using our Dropbox API explorer.

     

    Please bear in mind that there is a possibility that your account has been updated to our new team space functionality. For further information on the latest updated team space, please review the following link:

     

     

    While implementing the Dropbox API with the updated team space, you will need to configure your API calls to operate within the "team space", in order to interact with files/folders in the team space. To do so, you'll need to set the "Dropbox-API-Path-Root" header with your Dropbox API request. For further information, please review the following link:

     

16 Replies

Replies have been turned off for this discussion
  • awb's avatar
    awb
    Helpful | Level 7
    2 years ago

    Hi Greg-DB 

    I'm currently reviewing the logs for a customer of ours, is it ok to share folder ids in the forum?

     

    We currently us the following to list folders/files in a team folder

     

    var account = dropboxTeamClient.AsMember(teamMemberInfo.Profile.TeamMemberId).Users.GetCurrentAccountAsync()

     

    dropboxTeamClient.AsMember(account.TeamMemberId).WithPathRoot(new PathRoot.NamespaceId(account.RootInfo.RootNamespaceId))

    dropboxTeamClient.AsAdmin(account.TeamMemberId).WithPathRoot(new PathRoot.NamespaceId(account.RootInfo.RootNamespaceId)

    and then process the child folders

     

    I have the id of the folder in our logs which I can no longer locate in dropbox, both using asadmin and asmember returns a not found. This id looked to be assocaited to a team folder, which is why I asked the question about team folder ids changing.

     

    Is there anyway to locate this folder when I have the ID? 

    Thanks

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    2 years ago

    awb wrote:

    ...

    Is there anyway to locate this folder when I have the ID? 

    ...


    Hi awb,

    Did you try GetMetadataAsync method with your ID? If not, give it a try. Does this call return something meaningful or an error? If error, what error? 🧐

    Hope this gives direction?

  • awb's avatar
    awb
    Helpful | Level 7
    2 years ago

    thanks Здравко , just given that a try and get not found. Tried looping through users and admins 

    dropboxTeamClient.AsAdmin(account.TeamMemberId).WithPathRoot(new PathRoot.NamespaceId(account.RootInfo.RootNamespaceId)).Files.GetMetadataAsync

     

    dropboxTeamClient.AsMember(account.TeamMemberId).WithPathRoot(new PathRoot.NamespaceId(account.RootInfo.RootNamespaceId)).Files.GetMetadataAsync

     

    UPDATE, its a deleted folder Здравко thanks. Still need to get my head around what has been going on in this customers Dropbox.

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    2 years ago

    awb wrote:

    ... Tried looping through users and admins 

    ...


    ... and? 🤔 What is the result? You didn't mention. If result, what's it, otherwise, what's the error?

  • awb's avatar
    awb
    Helpful | Level 7
    2 years ago

    If I included deleted items in the request, the item is returned. In my orginal requests I did not include deleted items.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    I see Здравко already offered some helpful guidance so it seems like you have this sorted out, but let us know if you still need help with anything.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!