Google Drive API call to insert Public Share permissions on Fusiontables causes Internal Error

馋奶兔 提交于 2019-12-01 05:52:13

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.

I have a good news!

I've received an email from googletables-feedback. They says that it should be working now.

My code on Google Client JS API 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)
}

If you'd be OK with a temporary workaround, inserting Fusion Table public share permission still works with older XML-based GData API. You can check it out here, though beware of the red banner at the top of the page saying 'The deprecation period for Version 3 of the Google Documents List API is nearly at an end. On April 20, 2015, we will discontinue service for this API.'

So if you need to workaround the problem now, that would keep you going till April and then let's hope the Drive API bug gets fixed before that...

Personally, the document I was attempting to add the permissions to had become invalid. This might also be an issue for someone else.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!