Hello,
I am working on a .NET app, which is integrated with the dropbox api. I managed to upload, list, delete files without any problems. Now, I am trying to use webhooks for my app. I have a dedicated dropbox account which linked to my app and this account has "full access" to my dropbox storage.
We want Dropbox to notify my app when files are added or deleted. After going through documentation [https://www.dropbox.com/developers/reference/webhooks#tutorial], I am managed to get webhook trigger on file add/delete of a file in my storage using ListFolderContinue API. So far so good.
Here is mode code snippet
//---------------------------------
var cursor = getPreviousCursor( user); // to get previously stored cursor
using (var client = new DropboxClient(accessToken))
{
ListFolderResult list = await client.Files.ListFolderContinueAsync(cursor);
bool bHasMore = true;
while (bHasMore)
{
foreach (var entry in list.Entries)
{
if (entry.IsDeleted || entry.IsFolder)
continue;
string fname = entry.Name;
}
cursor = list.Cursor;
bHasMore = list.HasMore;
UpdateCursor(user, cursor); // to store latest cursor
}
}
//--------------------------------
Now here comes the problem that I am facing.
Above code works only if I modify files in root folder ("/") folder of the dropbox storage. If I modify a file in a folder e.g. "/Sample/Project/test.txt", I receive webhook trigger but "ListFolderResult list" is always empty.
To sumarize I am not getting information of modified files in the folders except root folder of dropbox storage.
Please help.