We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
jerry14
4 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)...
jerry14
4 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-DB
Dropbox Community Moderator
4 years agoIf 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 & Feedback
Find help with the Dropbox API from other developers.
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!