【问题标题】:“Some requested scopes cannot be shown” when using Datastudio API使用 Datastudio API 时“无法显示某些请求的范围”
【发布时间】: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


    【解决方案1】:

    不,此处对 GSuite 和 Cloud Identity 域的引用是对用户所属域/组织的引用。为了执行 DataStudio 文档中的最后一步 [1],您需要 G Suite 管理员以允许您的应用程序为该域中的所有用户请求 datastudio 范围。这一步是必需的。此 API 仅供 GSuite 用户使用。

    [1]https://developers.google.com/datastudio/api#authorize_oauth_client

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-08
      • 2019-09-18
      • 2021-11-10
      • 2014-08-03
      • 2019-01-30
      • 2020-10-27
      相关资源
      最近更新 更多