【发布时间】:2019-01-11 17:25:04
【问题描述】:
尝试使用 GDrive API 在 Google 表格文件中创建评论并收到以下错误:
Google.Apis.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;
【问题讨论】:
标签: c# google-drive-api