我想更新云端硬盘中文件的图像位置标签。在这一点上,我已经确定了两种似乎可以做到这一点的方法,并尝试使用“试用此 API”栏进行更改
- 文件:更新 https://developers.google.com/drive/v2/reference/files/update
- 或 Files:patch ...drive/v2/reference/files/patch
我提供了一个 fileID,将字段设置为“imageMediaMetadata/location”以过滤对我感兴趣的数据的响应,并将请求正文设置如下
{
"imageMediaMetadata": {
"location": {
"latitude": -30.12345678901234
"longitude": 170.12345678901234
}
}
}
两种方法都返回绿色成功代码 200 和返回字符串,但是返回字符串显示数据未更改(我正在尝试更改此图像的纬度符号)。
{
"imageMediaMetadata": {
"location": {
"latitude": 30.12345678901234
"longitude": 170.12345678901234
}
}
}
尝试更新方法的另一个位置是 developers.google.com/apis-explorer/#p/drive/v3/drive.files.update
这声称它“使用补丁语义更新文件的元数据和/或内容。”。
使用相同的输入,此方法返回错误代码 - 403,具体如下:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "fieldNotWritable",
"message": "The resource body includes fields which are not directly writable."
}
],
"code": 403,
"message": "The resource body includes fields which are not directly writable."
}
}
所以看起来要么(a)我形成请求的方式有问题,要么(b)位置数据是只读的,不能通过API修改。(或者这可能在正常使用中有效,但是不是通过 API 资源管理器?)
谁能提供更多信息?谢谢