Calling the Google Drive API to insert Public Share permissions on Fusiontables causes an internal error

I am trying to use the Google Drive APIs to make Fusiontable publicly available and could not get it to work. I can use the OAuth 2.0 platform to insert shared sharing permissions for other Google Drive documents, but for FusionTables I get an HTTP 500 error, "Internal Error". Please note that I tried to include in each area available under the "Drive API v2" and "Fusion Tables API v1" APIs.

I know that Google no longer develops and supports FusionTables, but I wonder if anyone has found a workaround that allows them to work around this problem? I have also not tried outdated / outdated versions of the API.

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

Inquiry:

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 answer:

 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" } 
+5
source share
3 answers

This is due to an error in the API driver. I discovered an internal error and raised a question with the development team. There are no known workarounds at this time.

+3
source

I have good news!

I received an email from googletables-feedback. They say that now it should work.

My code in JS API of Google Client works fine

 var setAccess = function setAccessF() { gapi.client.request({ path : '/drive/v2/files/{fileID}/permissions', method : 'post', body : { 'value' : 'anyone', 'type' : 'anyone', 'role' : 'reader' } }).then(opt_onFulfilled, opt_onRejected); } function opt_onRejected(e) { console.log(e) } function opt_onFulfilled(e) { console.log(e) } 
+2
source

If everything is okay with a temporary workaround, pasting the Fusion Table file sharing permission still works with the old GData API XML interface. You can check here , but beware of the red banner at the top of the page saying: "The deprecation period for version 3 of the Google documents API list is almost over. On April 20, 2015 we will stop serving this API.

So, if you need to solve the problem now, it will keep you until April, and then let us hope that the error in the API driver will be fixed before that ...

0
source

Source: https://habr.com/ru/post/1206257/


All Articles