cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Get summer ready with Dropbox basic - travel documents, plans, progress reminders and more, right over 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: 

web hook handling

web hook handling

dolphin_cloudsf
Explorer | Level 4

hi ,

when a chnage happend i recived a notification.

at first as i know i need to return 200 to verify the notification recived.

then when i make a nother change i am calling 

  var res22 = client.AsMember(null).Files.ListFolderAsync("");

and get the cursor and then calling  to

     var res = client.AsMember(null).Files.ListFolderContinueAsync(res2.Result.Cursor);

 

 

i also tried to call

var res2 = client.AsMember(null).Files.ListFolderGetLatestCursorAsync("");

and then to 

var res4 = client.AsMember(null).Files.ListFolderContinueAsync(res22.Result.Cursor);

 

and no error recived but also no chnage recived .

 

how to i get the actual  changed  data  file/folder ?

thanks 

 

 

4 Replies 4

Re: web hook handling

Greg-DB
Dropboxer

Using ListFolderAsync and ListFolderContinueAsync is the right way to list the contents of a folder. Are you saying that both of those calls aren't returning any entries? Make sure you list out the entries of both calls; if there aren't many items in the folder, the entire list may only be returned to the first call to ListFolderAsync.

In either case though, you can store the latest cursor for the user. When you then get a webhook notification, you can use that cursor with ListFolderContinueAsync to get information on only what changed since then. Note that you don't need to call ListFolderAsync again in this scenario.

Re: web hook handling

dolphin_cloudsf
Explorer | Level 4

Hi Greg ,

for your questions:
- nothing returnning any entries 😞

 

i want to verify i am doing all thinks right.

 

1. when i get a notification i need to return an answer with status of 200 in 10 sec.

then i am doing another change in dropbox and i am calling :
var res2 = client.AsMember(null).Files.ListFolderGetLatestCursorAsync("");

and then to

var res4 = client.AsMember(null).Files.ListFolderContinueAsync(res22.Result.Cursor);

 

no result of changes .file or folder.

questions:

 

- what is the maxsimum time that i have to call the listFolderContinue to get the changes.

- how do i know i am using the right Cursor?

if i am calling (.ListFolderGetLatestCursorAsync) - is that OK?

do you have some sample code in C# that maybe i can test it .

 

i really need to get it to work .

 

thanks from advance

Re: web hook handling

dolphin_cloudsf
Explorer | Level 4

Thnak you greg for your help - 

ok greg i manage to get the changes from dropbox.

 

but now i have another question if i can :).

 

1. when i renmae a file i get 2 notifications 

   - deleted metadata

  - file Metadata

 

questions:

1. how do i know the relations between the two?

2.  if i am getting two file renamed - so actually i get 2 notification for deleted metadata and 2 notifications for file metadata .

i do i know who belong to who?

3.  in the object there are to objects (as deleted , as file ) that are both recursice and looping . so if i want to serelize the object it is not possible . i am using nuget version 4.7.0 - is this issue fix later on ?

 

hope you can help me as soon as possible 

is there any chnage we can continue this by email ?

 

waiting for your input

Re: web hook handling

Greg-DB
Dropboxer

1. When you receive a DeletedMetadata, it will contain a PathLower value. That's the path at which the item used to exist. 

You should look up that entry in whatever local state you're maintaing and remove it.

When you receive a FileMetadata, it will contain an Id value. You can compare that to previous entries that you had to see if it was moved/renamed from another location.

2. File IDs are unique, so as above, you can use them to identify different files across move/rename operations.

3. I'm not sure I understand this question. Can you clarify?

If you would prefer to get API support privately over email, you can open an API ticket here instead.

Poll
Which Dropbox Plan do you have?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    dolphin_cloudsf Explorer | Level 4
What do Dropbox user levels mean?
Need more support?