Google Drive API 调用在 Fusiontables 上插入公共共享权限导致内部错误 [英] Google Drive API call to insert Public Share permissions on Fusiontables causes Internal Error

查看:21
本文介绍了Google Drive API 调用在 Fusiontables 上插入公共共享权限导致内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用 Google Drive API 使 Fusiontable 公开可读,但无法使其正常工作.我可以使用 OAuth 2.0 Playground 为其他 Google Drive 文档插入公共共享权限,但对于 Fusiontables,我收到 HTTP 500 错误内部错误".请注意,我已尝试包含Drive API v2"和Fusion Tables API v1"下可用的所有范围.

I have been trying to use the Google Drive API to make a Fusiontable publicly readable, and have not been able to get it to work. I am able to use the OAuth 2.0 Playground to insert public share permissions for other Google Drive documents, but for Fusiontables I get an HTTP 500 error, "Internal Error". Note that I have tried including every scope available under "Drive API v2" and "Fusion Tables API v1".

我知道 Google 不再开发和支持 Fusiontables,但我想知道是否有人找到了解决此问题的解决方法?我也没有尝试过 API 的旧版/已弃用版本.

I'm aware that Google is no longer developing and supporting Fusiontables, but I'm wondering if anyone has found a workaround that allows them to get around this problem? I haven't tried legacy/deprecated versions of the API either.

以下是实际的 API 请求格式和来自 OAuth Playground 的对 Fusiontable 权限插入 (HTTP 500) 和 Doc 权限插入 (HTTP 200) 的响应.请求之间的唯一区别是请求 URI 中的 fusiontable_id 或 document_id:

Here's are the actual API request format and responses from OAuth Playground for a Fusiontable permissions insert (HTTP 500), then a Doc permissions insert (HTTP 200). The only difference between requests is the fusiontable_id or document_id in the Request URI:

请求:

POST /drive/v2/files/<fusiontable_id or document_id>/permissions HTTP/1.1
Host: www.googleapis.com
Content-length: 33
Content-type: application/json
Authorization: Bearer <access_token>

{"role":"reader","type":"anyone"}

Fusiontable 响应:

Fusiontable Response:

HTTP/1.1 500 Internal Server Error
Content-length: 180
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Expires: Tue, 04 Nov 2014 23:51:58 GMT
Vary: Origin,Referer,X-Origin
Server: GSE
Cache-control: private, max-age=0
Date: Tue, 04 Nov 2014 23:51:58 GMT
X-frame-options: SAMEORIGIN
Content-type: application/json; charset=UTF-8
{
  "error": {
    "code": 500, 
    "message": "Internal Error", 
    "errors": [
      {
        "domain": "global", 
        "message": "Internal Error", 
        "reason": "internalError"
      }
    ]
  }
}

文档回复:

HTTP/1.1 200 OK
Content-length: 281
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Vary: Origin,Referer,X-Origin
Server: GSE
Etag: "M4l5RvCt2StP2jOGfgyJPGdTZTc/dgFZz37LrQjIXplUkmnh3VtemzQ"
Pragma: no-cache
Cache-control: no-cache, no-store, max-age=0, must-revalidate
Date: Wed, 05 Nov 2014 15:35:56 GMT
X-frame-options: SAMEORIGIN
Content-type: application/json; charset=UTF-8
{
  "kind": "drive#permission", 
  "etag": ""M4l5RvCt2StP2jOGfgyJPGdTZTc/dgFZz37LrQjIXplUkmnh3VtemzQ"", 
  "role": "reader", 
  "type": "anyone", 
  "id": "anyone", 
  "selfLink": "https://www.googleapis.com/drive/v2/files/<document_id>/permissions/anyone"
}

推荐答案

这似乎是由于 Drive API 中的错误.我已经找到了内部错误,并向工程团队提出了这个问题.目前没有已知的解决方法.

This appears to be due to a bug in the Drive API. I've located the internal error and have raised the issue with the engineering team. At this time there are no known workarounds.

这篇关于Google Drive API 调用在 Fusiontables 上插入公共共享权限导致内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆