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

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

问题描述

我一直在尝试使用Google Drive API将Fusiontable变成公开可读的,并且无法使其正常工作。我可以使用OAuth 2.0 Playground为其他Google Drive文档插入公共共享权限,但对于Fusiontables,我收到HTTP 500错误内部错误。请注意,我已尝试包括Drive API v2和Fusion Tables API v1中的所有范围。 我知道Google不再开发和支持Fusiontables,但我想知道是否有人找到了解决方法,让他们解决这个问题?我还没有尝试API的旧版/弃用版本。



以下是实际的API请求格式以及OAuth Playground对Fusiontable权限插入(HTTP 500) ,然后一个文档权限插入(HTTP 200)。请求之间的唯一区别是请求URI中的fusiontable_id或document_id:



请求:

  POST / drive / v2 / files /< fusiontable_id或document_id> /权限HTTP / 1.1 
主机:www.googleapis.com
内容长度:33
内容-type:application / json
授权:承载< access_token>

{role:reader,type:anyone}

Fusiontable Response:

  HTTP / 1.1 500内部服务器错误
内容长度:180
X-xss-protection:1; mode = block
X-content-type-options:nosniff
过期时间:2014年11月4日星期二23:51:58 GMT
Vary:Origin,Referer,X-Origin
Server:GSE
Cache-control:private,max-age = 0
日期:2014年11月4日星期二23:51:58 GMT
X-frame-options:SAMEORIGIN
内容类型:application / json; charset = UTF-8
{
错误:{
code:500,
message:内部错误,
错误: [
{
domain:global,
message:Internal Error,
reason:internalError
}
]
}
}

文件回应:

  HTTP / 1.1 200 OK 
内容长度:281
X-xss-protection:1; mode = block
X-content-type-options:nosniff
过期时间:星期五,1990年1月1日00:00:00 GMT
不同:Origin,Referer,X-Origin
服务器:GSE
Etag:M4l5RvCt2StP2jOGfgyJPGdTZTc / dgFZz37LrQjIXplUkmnh3VtemzQ
Pragma:no-cache
Cache-control:no-cache,no-store,max-age = 0,必须重新验证
日期: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:任何人,
id:任何人,
selfLink:https://www.googleapis.com/drive / v2 / files /< document_id> / permissions / anyone
}


解决方案

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


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".

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.

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:

Request:

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 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"
      }
    ]
  }
}

Doc response:

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"
}

解决方案

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天全站免登陆