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?
Здравко
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.
milankj
12 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
- Здравко12 months agoLegendary | Level 20
milankj wrote:...
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
Hm..🤔 As I said it's possible in spite unlikely. Do you see the same for the same file in Dropbox web interface? Also, do you receive in the response a cursor? 🧐
- milankj12 months agoExplorer | Level 3
For a file to which i have editor access, in web interface too it shows no info on the owner of file. Just that i have an editor access.
And no no cursor is received, (my friend shared the file with me only).
My guess is that shared folder and shared files are treated differently. The folders contain a "shared_folder_id" with helps to gather sharing information on the folder. But for files im just using the primary file id , there is no explicit shared if like the folders
- Здравко12 months agoLegendary | Level 20
milankj wrote:...
My guess is that shared folder and shared files are treated differently. ...
No actually; they are treated in almost same way.
milankj wrote:... The folders contain a "shared_folder_id" with helps to gather sharing information on the folder. But for files im just using the primary file id , there is no explicit shared if like the folders
Yes, that's the only difference, but nothing more. That's why more convenient way, when you're interested in files residing in arbitrary folders, is to use list_file_members instead of look in advance for containing folder - more consecutive calls needed.
milankj wrote:...
And no no cursor is received, (my friend shared the file with me only).
...
In such a case you're the only participant of the shared file currently. Your friend seems to left sharing of discussed file (intentionally or not) and that's why the file is ownerless. Such "mistakes" (if mistakes) are likely to bring up after file editing - some editors replace the edited file on save instead of update. Better share files as part of shared folder instead of individually - in such case probability for unintentional unshare is less likely. Inform your friend about that.
About Discuss Dropbox Developer & API
795 PostsLatest Activity: 3 days ago
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!