cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right 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: 

List folder api with admin header

List folder api with admin header

sarshavs
Explorer | Level 3

Hello, im using the Api list_folder and try to get any event for any user in the team. is it possible?
Im using the header dropbox-api-select-admin and i saw in the docs - 

-----

Specifically, there are two different modes for Dropbox-API-Select-Admin header that calls may support:

  • Whole Team The endpoint can access content of team folders and team spaces as well as the team members' home namespaces.

-----
but i see the list folder dont returns team members home ns events

that the api's im using:
https://api.dropboxapi.com/2/files/list_folder/get_latest_cursor

https://api.dropboxapi.com/2/files/list_folder/continue

 

Thanks for any help

 

11 Replies 11

Здравко
Legendary | Level 20

@sarshavs wrote:

...
that the api's im using:
https://api.dropboxapi.com/2/files/list_folder/get_latest_cursor

https://api.dropboxapi.com/2/files/list_folder/continue

...


Hi @sarshavs,

Just to underline here that as a result of such calls sequence only file/folder changes happened between first and second endpoint calls will get back, not something before. Are you sure there is such thing? 🧐 The key moment here is not only what end point you call but also how!!!

Share your entire callings sequence/logic together with the unexpected output and what you expect to be there for further comments.

Hope this gives direction.

Greg-DB
Dropbox Staff

@sarshavs As Здравко pointed out, if you use /2/files/list_folder/get_latest_cursor, the returned cursor will only allow you to get entries from after the point in time when you made that call, up until when you make the /2/files/list_folder/continue call. If you instead want to get all entries, you would need to start from /2/files/list_folder instead.

 

In any case, all three of these endpoints do support 'Dropbox-API-Select-User' and 'Dropbox-API-Select-Admin', but you would need to call and supply each relevant member ID as needed. (And if you want to list all of the content across the team, check out this post.)

 

Also, be sure to check out the Team Files Guide for information on how to access team-owned content.

 

Alternatively, to list events for the team, check out the /2/team_log/get_events[/continue] functionality.

sarshavs
Explorer | Level 3

Thanks for the Answer, @Greg-DB @Здравко 
Im aware when im using latest cursor only evens after will be visible.
I will demonstrate what i need to achieve 
I have app which dropbox accounts are connected to (can be business account and non business accounts)
My goal is to get any new event in the account without knowing which user has actually generated the event. 
I want to prevent from using webhook and instead trigger every couple minutes task that will fetch new events for specific account. Im trying to achieve that with one cursor for the account and the solution will be applicable both for business / no business accounts.

Both your suggestions using business api so for non business i would need to use something different. 
Thanks for the time and the answeres 🙂

sarshavs
Explorer | Level 3

Another question - all the non business accounts has upgraded to be business accounts? so every account now will support the business api if that the case it will work for me with using the get events ep.

If not so does i need to supply in list folder ep for non business account the member id or i will get all the files for any user in the non business account?

Thanks

Здравко
Legendary | Level 20

@sarshavs, If you want to check if there is some event (file/folder change), usage of endpoint /2/files/list_folder/longpoll is much more efficient compared to continuously pooling. Such a solution would work with both personal and team account. Once an event appears you can check what has changed.

Good luck.

sarshavs
Explorer | Level 3

@Здравко What you suggesting only notify if changes has made and dont return which user or how i can get what specifically changed in the account... because then i need to go back to list folder and then the same problem

Здравко
Legendary | Level 20

I just said it's more efficient - low latency (if this is important for you). Something that difficult can be achieved just looping with listing only. For individual account you cannot achieve information who changed particular file, only the file(s) can be figured out. For team account, you have to use team endpoints though. In your application you can decide whether you have to use team endpoints based on current account in use (is it team or individual). That's it.

sarshavs
Explorer | Level 3

@Greg-DB  For business account i will use events api and my question is for non business accounts - if for example accounts with family plan which is not business account i can get all the files for any user with the admin user token or do i have some workaround here to detect changes in the account without iterate and check each user files with the according token? i want to be able to store one cursor for the account which will detect any change in the account for any user. 

Greg-DB
Dropbox Staff

@sarshavs wrote:

Both your suggestions using business api so for non business i would need to use something different. 

Note that the /2/files/list_folder[/continue] endpoints can be used by any type of account, Business or not.

 


@sarshavs wrote:

Another question - all the non business accounts has upgraded to be business accounts? so every account now will support the business api if that the case it will work for me with using the get events ep.

No, not all Business accounts have or will be upgraded to Business accounts. Dropbox offers a variety of different types of plans and users can choose which to use.

 

If not so does i need to supply in list folder ep for non business account the member id or i will get all the files for any user in the non business account?

When the app is linked to a specific account (Business or not), the app does not need to specify the member ID when calling /2/files/list_folder[/continue], since there is only one account connected anyway. (When the app is connected to the team itself, it needs to specify the member ID in order to identify which account to operate on.)

 


@sarshavs wrote:

i want to be able to store one cursor for the account which will detect any change in the account for any user. 


For any particular user account, you can use the /2/files/list_folder[/continue] functionality, starting with a path parameter of the empty string "", to continuously list the contents of that root using the last returned cursor. You would store multiple cursors, one per user account, to monitor multiple user accounts.

 

I suggest reading the File Access Guide and Detecting Changes Guide, if you haven't already.

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    sarshavs Explorer | Level 3
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?