Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
jerry14
3 years agoExplorer | Level 4
API - Getting owner information of a file that is not shared
Hi - I am trying to get owner information of a file that is not shared. I tried the below - FileMetadata fileMetadata = (FileMetadata) dbxTeamClient.asAdmin(adminId).files().getMetadata(fileId)...
Greg-DB
Dropbox Community Moderator
3 years agoFiles that aren't shared won't be explicitly listed as having an owner. Files that aren't shared are just implicitly considered to be owned by the user account that contains the files.
jerry14
3 years agoExplorer | Level 4
Thanks for the response. In that case, whats the best way to find the owner information using the APIs? I checked the metadata and other file related APIs to see if I can get the information. I couldn't find any or I must have missed something. I need this because I am accessing files that belongs to different members using admin credentials and the connected member (admin member) is not the owner of the file.
- Greg-DB3 years ago
Dropbox Community Moderator
If you've received a file ID from somewhere, it may be best to record the account that was associated when receiving that file ID. For example, if you are reading from the event log, and are taking the file ID from events about files there, you should also read out and save the account ID for the associated account from the event information.
If you only have the file ID though and don't know what account on the team it corresponds to, you should be able to get the account ID from FileSharingInfo.getModifiedBy() in the returned FileMetadata.getSharingInfo(), e.g., on the FileMetadata returned by getMetadata as in your example, even if it's not in a shared/team folder. (The "Sharing" term is a bit of a misnomer in this case; it would be set though because you're accessing the file information from another account via the admin access.)
You can look up the account information for the account ID using getAccount. You'd need to use asMember for that instead of asAdmin though.
The team space itself is just considered owned by the team, not a specific user.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!