【发布时间】:2021-05-19 21:04:42
【问题描述】:
我正在尝试在我们的网络应用程序中使用google data studio apis。
我设置了一个本地 Web 服务器,它在 localhost:8081 返回 html file(我更新了从我们的凭据控制台获取的 apikey 和客户端 ID。)
部分代码:
var apiKey = 'AXXX';
var discoveryDocs = ["https://datastudio.googleapis.com/$discovery/rest?version=v1"];
var clientId = 'XXX.apps.googleusercontent.com';
var scopes = 'https://www.googleapis.com/auth/datastudio https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid';
function makeApiCall() {
gapi.client.request({
'path': 'https://datastudio.googleapis.com/v1/assets:search?assetTypes=Report',
}).then(function(resp) {
console.log(resp);
});
}
一些设置:
但是当我填写我的 gmail 帐户/密码时,我得到了the same error:
然后我从文档中发现:
Note: The Data Studio API is currently only available to G Suite and Cloud Identity domains.
看来我必须获得一个域才能使用GDS apis,并且localhost不起作用?我说的对吗?
【问题讨论】:
标签: google-oauth google-data-studio google-data-api