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
12 months agoExplorer | Level 3
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?
Здравко
12 months agoLegendary | Level 20
Hi milankj,
Did you try using /2/sharing/list_file_members for whatever file you're interested in? For the file owner you'll get access_type... owner. 😉
Hope this helps.
- milankj12 months agoExplorer | 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_foldersto 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.
- Здравко12 months agoLegendary | 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.
- milankj12 months agoExplorer | Level 3
using /2/sharing/list_folder_members my was able to get owner's info on a shared folder( a folder shared with me - not me being the owner), "shared_folder_id" value was used.
In case of a file shared to me (not in any folder just the single file) with editor access, while using /2/sharing/list_file_members the response shows only a single user, and that is me being the editor
About Discuss Dropbox Developer & API
Make connections with other developers
795 PostsLatest Activity: 4 days agoIf 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!