cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Webhooks Business API .NET

Webhooks Business API .NET

selvir
Explorer | Level 3

Hi. I'm using webhooks to monitor files/folders changes.

For personal accounts all is good, I manage to do it, but I do have issues with Team accounts.

 

First of all, I do have console app which is for using the Business API and do have member file access permission.

On login I do save teamId, teamAdminId and the token locally. Also I do keep the cursor locally, and geting it  using Team.AsAdmin("{teamAdminId }").ListFolderGetLatestCursorAsync() on first login/authorization with the console app.

 

On webhook event, I do receive it in this format:

 

{
"list_folder": {
"teams": {
"dbtid:xxxx": [
"dbmid:xxxx",
"dbmid:xxxx",
"dbmid:xxxx"
]
}
},
"delta": {
"teams": {
"dbtid:xxxx": [
"dbmid:xxxx",
"dbmid:xxxx",
"dbmid:xxxx"
]
}
}
}

Based on the change for specific teamId, I do try to use the implementation of .NET SDK

 

using (DropboxTeamClient teamClient = new DropboxTeamClient(accessToken))
{
      var folderResult = await teamClient.AsAdmin(adminId).Files.ListFolderContinueAsync(cursor);
}

I do always get empty Entries under folderResult response , after each webhook.

 

First, is it possible to read file changes for Team folders? 

Can you please help me and let me know what I'm doing wrong? 

Thanks!

1 Reply 1

Greg-DB
Dropbox Staff

It sounds like the cursor you're using is probably for the member's "member folder", but not the "team space". (And so, if the changes happen to just be in the team space, you wouldn't see them by listing the member folder.)

 

The Dropbox API does offer the ability to access and list the contents and changes in the team space, but you'll need to configure your calls specifically to do so. You can find information on how to do so in the Namespace Guide.

 

In the .NET SDK, you can set the Dropbox-API-Path-Root header discussed in that guide by using the DropboxClient.WithPathRoot method. E.g., you can use that when first calling ListFolderGetLatestCursorAsync to get a cursor for the team space instead of the member folder.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?