We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

krishnpriya12's avatar
krishnpriya12
Explorer | Level 3
2 months ago

Regarding APIs for Team shared folder and non shared folders

Hi Team,

 

I am integrating CASB with dropbox. Previously we were using this condition to add the header in following API:  https://api.dropboxapi.com/2/files/copy_reference/get

Dropbox-API-Path-Root = "#account_type == 'team' ? '{\".tag\": \"namespace_id\", \"namespace_id\": \"' + #root_namespace_id + '\"}' : ''"

where we were making this api call to get the "account_type-> $[''body''][''root_info''][''.tag'']" and "root_namespace_id-> $[''body''][''root_info''][''root_namespace_id'']" , 

https://api.dropboxapi.com/2/users/get_current_account

 

Earlier this approach was working fine for all type of events. Recently we are experiencing an issue when the events are generated in team shared space.

So for all the user we have currently the account_type is coming as business and that's why we are passing Dropbox API Path Root as null and we are getting error in copy ref api for shared file event.

Do you think this is the right way to handle the scenario for all the type of events that we received from team logs api?

Is there any other parameter in the team log api that we can rely on to distinguish between when to call copy ref api with that header or not? Or let us know if this use case(team log events for file/folder shared/non shared all) is achievable by hitting any other api?

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The [''root_info''][''.tag''] returned by /2/users/get_current_account doesn't indicate the type of the account; it actually indicates the type of the root currently used by the account. A "team" value there indicates that the root is a shared team root, but it is possible for an account to be on a team but not have a shared team root (which is the "updated team space" configuration in particular). Refer to the Team Files Guide and this post (linked at the top of the guide) for more information on this.

     

    For that reason, just checking for a "team" root isn't the right way to determine if you need to use the "Dropbox-API-Path-Root" header. Please refer to the linked resources above for more information on when/how to do so.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API

Make connections with other developers

795 PostsLatest Activity: 5 days ago
192 Following

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 or Facebook.

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!