cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

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

Highlighted

Issue with access files

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
Highlighted

Re: Issue with access files

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 ] } } 




 

Highlighted

Re: Issue with access files

Dropboxer

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
Highlighted

Re: Issue with access files

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 .
Highlighted

Re: Issue with access files

Dropboxer

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.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?