0
ドライブを使用してChrome拡張機能からデータを保存しようとしています。chrome拡張子にgapi.client.driveを正しく使用する方法
まず、私は、ファイルのリストを取得しようと次に
"oauth2": {
"client_id": "999999.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/drive.appdata"
]
},
をmanifest.jsonをするために必要なオプションを設定します。
$.getScript("https://apis.google.com/js/client.js", function() {
gapi.load('client', function() {
console.log("gapi.client is loaded")
gapi.client.load('drive', 'v3', function() {
console.log("gapi.client.drive is loaded");
chrome.identity.getAuthToken({'interactive': true}, function (token) {
gapi.client.setToken({access_token: token});
console.log("token :", token);
gapi.client.drive.files.list().then(function (list) {
console.log(list)
})
});
});
});
});
コンソールは言った:
gapi.client is loaded
gapi.client.drive is loaded
token : [TOKEN]
し、エラーがありますそのように:
"code": 403,
"message": "The granted scopes do not give access to all of the requested spaces."