You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

sarshavs's avatar
sarshavs
Explorer | Level 3
8 months ago

List folder api with admin header

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

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox 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's avatar
      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. 

    • sarshavs's avatar
      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 🙂

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox 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.

         

  • Здравко's avatar
    Здравко
    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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,888 PostsLatest Activity: 3 hours ago
326 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!