C# 尝试在GDrive API v3上创建注释时出错

C# 尝试在GDrive API v3上创建注释时出错,c#,google-drive-api,C#,Google Drive Api,试图使用GDrive API在Google Sheets文件中创建注释,但收到以下错误: Google.api.Requests.RequestError 此方法需要“fields”参数。[400] 错误[ 消息[此方法需要'fields'参数。] 位置[字段-参数]原因[必需]域[全局] ] 不确定在哪里指定fields参数 我试图搜索参数的放置位置,并查看了v2和v3文档,这两个文档都没有表明需要指定字段参数 下面是我正在使用的代码: string result = "success"; t

试图使用GDrive API在Google Sheets文件中创建注释,但收到以下错误:

Google.api.Requests.RequestError 此方法需要“fields”参数。[400] 错误[ 消息[此方法需要'fields'参数。] 位置[字段-参数]原因[必需]域[全局] ]

不确定在哪里指定fields参数

我试图搜索参数的放置位置,并查看了v2和v3文档,这两个文档都没有表明需要指定字段参数

下面是我正在使用的代码:

string result = "success";
try {
    Comment oBody = new Comment {
        Content = commentText,
        Anchor = "{'r': 0, 'a': [{'matrix':{'c': 4}},  {'matrix':{'r': 4}}]}"
    };
    Comment oRequest = driveService.Comments.Create(oBody, fileId).Execute();
} catch (Exception e) {
    result = "Google API: " + e.Message;
}
textBox1.Text = result;
return result;

好吧,我已经设法钻研了我自己的代码并解决了它。我找到了指定fields参数的位置,现在我只是对字符串进行响应。我注释掉了锚,因为我还不知道它的结构(显示的锚是谷歌在我通过Id获取评论时显示的)

Comment oBody = new Comment {
    Content = commentText,
    //Anchor = "{\"type\":\"workbook-range\",\"uid\":0,\"range\":\"1561003787\"}",
};
CommentsResource.CreateRequest oRequest = driveService.Comments.Create(oBody, fileId);
oRequest.Fields = ("*");
Comment oResponse = oRequest.Execute();
result = JsonConvert.SerializeObject(oResponse, Formatting.Indented);