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: 

Issue with access files

Issue with access files

ankushkatiyar
Explorer | Level 3

Hello i want to access changed files in dropbox , so i created a webhook 

https://dpintegration.herokuapp.com/webhook

 and also i got data according to instruction mentioned in webhooks section

{ list_folder: { accounts: [ 'dbid:AACWK8UMlcqEvIjOCfL8gQrmy1uJvS8zzlE' ] },delta: { users: [ 542524594 ] } } 

 and i'm not using "Dropbox Business API" , i'm using "Dropbox API" .
and according to instruction mentioned in webhook section we need to use

 Note that only the user IDs and accounts with file changes are provided. Your app is expected to call /files/list_folder/continue to find out what files changed using the latest cursor your app previously stored for that account. If your app is still using v1, you can call /delta.

But when i'm using api call /list_folder i got all files and folders , and when i use "Dropbox-Api-Select-Admin"  in Header than i got "Error in call to API function "files/list_folder": Unexpected select user header. Your app does not have permission to use this feature" , so i need to use business api for access files ? 

Need solution for this problem how i get changed files by user , please provide me perfect solution for access this 

Thanks

4 Replies 4

ankushkatiyar
Explorer | Level 3

Also i collect latest curser using https://api.dropboxapi.com/2/files/list_folder and than i call https://api.dropboxapi.com/2/files/list_folder/continue, so i get all files that changed after pick curser and i use token in header .

So what is use of 

{ list_folder: { accounts: [ 'dbid:AACWK8UMlcqEvIjOCfL8gQrmy1uJvS8zzlE' ] },delta: { users: [ 542524594 ] } } 

we get from webhook post request ? 

because we got data directly using token. 

Suppose we upload 50 files so via get we get 50 files https://api.dropboxapi.com/2/files/list_folder/continue (  using previous cursor ), if i want to get current modified file so i need to store previous cursor first and than use api call ? 

 For this process we need to use 

{ list_folder: { accounts: [ 'dbid:AACWK8UMlcqEvIjOCfL8gQrmy1uJvS8zzlE' ] },delta: { users: [ 542524594 ] } } 




 

Greg-DB
Dropbox Staff

First, to clarify, if you're only using a Dropbox API app, not a Dropbox Business API app, you should not use the "Dropbox-API-Select-Admin". You can access the Dropbox API endpoints, such as the list_folder endpoints, without that header. 

The basic flow for using webhooks with list_folder would go like this:

  • the user connects to the app for the first time
  • the app stores the access token for that user, identified by the Dropbox account ID
  • the app starts listing the files and folders for the user using /2/files/list_folder and /2/files/list_folder/continue as necessary
  • the app stores the last returned cursor for that user, identified by the Dropbox account ID
  • the user leaves and some time passes
  • the user makes changes elsewhere
  • Dropbox sends the webhook notification for that user with the relevant account ID to the app's webhook URI
  • the app receives the webhook notification for that user and looks like up the access token and last received cursor for that account ID
  • the app calls /2/files/list_folder/continue with that access token and cursor to get the latest changes

ankushkatiyar
Explorer | Level 3
the app receives the webhook notification for that user and looks like up the access token and last received cursor for that account ID

From webhook notification i onlt got account id and delta user, so where i need to use these information ??

I got access token from token api after authentication and i use this key for list_folder and list_folder/continue

I got files changes when i use api , but i want to know where i need to use webhook information that i received .

Greg-DB
Dropbox Staff

The webhook notification includes the account ID of the user who had changes in their account. You can use that account ID to look up the user in your app so you know which one to update. This means you do need to record the Dropbox account IDs originally, but exactly how you manage your app's user model and database is up to you of course.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    ankushkatiyar Explorer | Level 3
What do Dropbox user levels mean?