dongmin4990 2018-12-13 20:09
浏览 9
已采纳

如何获得特定修订的所有修改用户

Follow up on Google Drive Rest API : How to get all Modifying Users of a specific Revision

It has been approximately 3 years, so I am not sure what the status is, but I thought I would ask again on the status.

I see that Google Drive API @ https://developers.google.com/drive/api/v3/reference/revisions/get

should actually do exactly what has been asked here, but when I make a call to the API it returns null for LastModifyingUser

I am not sure if this is a work in progress API or I am doing something wrong, so any help would be appreciated. Just to provide some reference, I am posting some basic code that is an addition to what can be found here... https://developers.google.com/drive/api/v3/quickstart/go

revision, err := srv.Revisions.Get(fileId, revisionId).Do() //fieldId and revisionId are fatched using proper calls

if err != nil {
    log.Fatalf("Unable to retrieve revision: %v", err)
}
fmt.Println("Revision:")
fmt.Printf("%+v
", revision.LastModifyingUser)
  • 写回答

1条回答 默认 最新

  • doucang6739 2018-12-13 23:18
    关注
    • You want to retrieve the value of lastModifyingUser from Revisions.Get() using Drive API v3.

    If my understanding is correct, how about adding the fields? At the default, the fields are id,mimeType,modifiedTime. So when you want to retrieve only values of lastModifyingUser, please modify as follows.

    From:

    revision, err := srv.Revisions.Get(fileId, revisionId).Do()
    

    To:

    revision, err := srv.Revisions.Get(fileID, revisionID).Fields("lastModifyingUser").Do()
    

    Note:

    • In this modified script, it is supposes that when you run your current script, no error occurs.
    • If you want to add lastModifyingUser to the default values of id,mimeType,modifiedTime, please set the fields to id,mimeType,modifiedTime,lastModifyingUser.

    Reference:

    If I misunderstand your question, I'm sorry.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大