We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.

Forum Discussion

milankj's avatar
milankj
Explorer | Level 3
12 months ago

Dropbox file or folder owner information

while listing files from any folder (even root) i need to know the owner of the file. is there any way i can get that?

    • milankj's avatar
      milankj
      Explorer | Level 3

      The /2/sharing/list_file_members only returns info about users, there is no information on the owner of the file.

      Im trying to create a common response that would come either from google drive or dropbox conditionally. In google drive i just have to call the file.list() i get all necessary info. like the owner, permissions, thumbnail , webview link etc.

      In drop box i'm collecting all these information from  4 different api : 
      /2/sharing/list_folders 

      to collect shared files i'm using :  /2/sharing/list_received_files

      to get the thumbnail for each files i'm using: /2/files/get_thumbnail_batch

       

      for user access info and metadata of file for preview link i'm using /2/sharing/get_file_metadata/batch 

       

      do you think is there any other way so i can reduce the number of api calls or either the response time ,cause its taking like 8 sec, to just collect 5-6 files.

      • Здравко's avatar
        Здравко
        Legendary | Level 20

        milankj wrote:

        while listing files from any folder (even root) i need to know the owner of the file. ...



        milankj wrote:

        The /2/sharing/list_file_members only returns info about users, ...


        Hm...🤔 "only"??? Probably I'm missing something here. Isn't the file owner a user too? 🧐

         


        milankj wrote:

        ..., there is no information on the owner of the file.

        ...


        Strictly speaking, there are corner cases - files/folders in Dropbox doesn't need to have owner in all cases (in spite not typical and rare case). When owner leaves a shared file/folder and there are still participants, ownership doesn't transfer automatically nor Dropbox expect to be transferred (in spite possible, but should be done explicitly). So, in such a case owner will be missing. Are you in such a situation?

        Another situation (more likely one) when you may not see the owner immediately is when there are many sharing participants and owner doesn't appear near front of the list. In such a case you see only the first page of the list and you have to call /2/sharing/list_file_members/continue one or more times (while there is cursor in requests response) to get the list' rest.

         

        When you organize your application, don't do it based on particular service API/interface! It becomes likely to have difficulties if/when try re-implement in another API/interface (normally - different services organize their interfaces in different ways). If you are aware what actually you need (not what you can get to in particular service), it likely to be the same when you get to implementation steps in context of different services. There are always some possible optimization steps - using a batch version when many files need to be processed for instance instead of using single file versions. Yes, Dropbox API is far from perfect, unfortunately. There are missing many features available in Dropbox application or through the web view, but... 🤷 that's it.

        Good luck.

    • Здравко's avatar
      Здравко
      Legendary | Level 20

      Actually list_file_members can be used for every file - including such not shared at all. In such a case will be just a single user - the owner (the account owner).