cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Whether you are transferring a single drive, a team or an entire organization, Movebot's cloud migration tool has been built to make your Dropbox migration simple - learn all about it here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I get the Owner name of a file that is shared with me using file id or preview url

How can I get the Owner name of a file that is shared with me using file id or preview url

sukantasaha24
Explorer | Level 3

How can I get the Owner name or email of a file that is shared with me using file id or file preview url.

I am using .Net SDK.

Thanks

 

7 Replies 7

Re: How can I get the Owner name of a file that is shared with me using file id or preview url

Greg-DB
Dropboxer

This depends on what kind of sharing you're referring to.

If the file is in a shared folder that you are a member of, you can use the ListFolderMembersAsync and ListFolderMembersContinueAsync methods to get the list of members, and check which one is the owner.

If the file has been individually shared with you, you can use GetFileMetadataAsync to get the metadata for the shared file, including the OwnerDisplayNames if available.

If you have a shared link for a file, you can use GetSharedLinkMetadataAsync to get the metadata for the shared link, including TeamMemberInfo, if the links owner's is a member of the same team.

Re: How can I get the Owner name of a file that is shared with me using file id or preview url

sukantasaha24
Explorer | Level 3

Hi,

Thanks for quick response.

In my case  file has been individually shared with me,

when I am trying to get the metadata of the file using  GetFileMetadataAsync and file id as a parameter to get the metadata of the shared file why OwnerDisplayNames is null?

Code :

var FileMetaData = await dc_Member.Sharing.GetFileMetadataAsync(SharedFile.Id);

 

Re: How can I get the Owner name of a file that is shared with me using file id or preview url

Greg-DB
Dropboxer

Unfortunately, the OwnerDisplayNames value can't always be fetched, though I don't have more specific information to share on when/why that is the case. I'll send this along to the team to ask to get this better documented though.

Re: How can I get the Owner name of a file that is shared with me using file id or preview url

swively
Explorer | Level 3

@Greg-DB 
Did you ever get clarification on why the OwnerDisplayNames field can't always be fetched?

Re: How can I get the Owner name of a file that is shared with me using file id or preview url

Greg-DB
Dropboxer

@swively No, unfortunately I don't have any updated guidance/documentation on that.

Re: How can I get the Owner name of a file that is shared with me using file id or preview url

swively
Explorer | Level 3

@Gred-DB
Is there any way to determine who owns/uploaded a file via the api? The best I can find is the owner of the shared folder, but I'm wondering if there is a way to see who uploaded a specific file.

Re: How can I get the Owner name of a file that is shared with me using file id or preview url

Greg-DB
Dropboxer

@swively Shared folders themselves have owners (see earlier in the thread), but individual files inside shared folders do not. You can see you last uploaded a file (i.e., the latest version of a file) via FileMetadata.sharing_info.modified_by though, e.g., as returned by /2/files/list_folder[/continue] or /2/files/get_metadata (or corresponding native methods in an SDK). You can also check the revision history for a particular file via /2/files/list_revisions.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    swively Explorer | Level 3
What do Dropbox user levels mean?
Need more support?