How to get last modified user information using google drive API?

后端 未结 1 957
执念已碎
执念已碎 2021-01-21 13:46

In Google.Apis.Drive.v2.Data.File class it just provides name of the last modified user. How to obtain full info of the user (like email, user id etc.).

<         


        
1条回答
  •  逝去的感伤
    2021-01-21 13:57

    I figured out how to do it in the Java API. It's 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 the modifying users.

    0 讨论(0)
提交回复
热议问题