How to get the latest changed user information using the Google Drive API?

In the Google.Apis.Drive.v2.Data.File class Google.Apis.Drive.v2.Data.File it simply provides the name of the last modified user. How to get full information about the user (for example, email address, user ID, etc.).

 var service = new DriveService(auth); Google.Apis.Drive.v2.Data.File file = service.Files.Get("fileid").Fetch(); file.LastModifyingUserName;// = "User Name" //How to get email id of this user? 

An organization may have more than one person with the same name and surname. This is the user id that is different. So I need an email id.

 Eg Allan Donald => allan1@corp.com Allan Donald => allan2@corp.com 

It is very possible.

+2
c # google-drive-sdk
May 17 '13 at
source share
1 answer

I figured out how to do this in the Java API. This is far from elegant, but it works.

 File file; // start with your file User user = file.getLastModifyingUser(); Permission permission = service.permissions().get(file.getId(), user.getPermissionId()).execute(); String email = permission.getEmailAddress(); 

You can also use the RevisionList interface to get all changing users.

0
Oct. 15 '13 at 0:47
source share



All Articles