获取 YouTube 频道的审核详细信息

Fetch auditDetails of YouTube channel

我正在尝试获取 YouTube 频道的 auditDetails

根据官方 API 文档(https://developers.google.com/youtube/v3/docs/channels/list) I am supposed to provide an authorization token that contains the https://www.googleapis.com/auth/youtubepartner-channel-audit 范围。

Authorization

A request that retrieves the auditDetails part for a channel resource must provide an authorization token that contains the https://www.googleapis.com/auth/youtubepartner-channel-audit scope. In addition, any token that uses that scope must be revoked when the MCN decides to accept or reject the channel or within two weeks of the date that the token was issued.

我目前正尝试通过点击以下 URL:

来获取 YouTube 频道的审核详情
https://www.googleapis.com/youtube/v3/channels?key=xxxxxxxxxx&id=UC9eSXrzVl9ZFLwsNSBgvTog&part=auditDetails

但是,它返回 Insufficient Permission 错误如下:

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "insufficientPermissions",
        "message": "Insufficient Permission"
      }
    ],
  "code": 403,
  "message": "Insufficient Permission"
  }
}

有人可以建议我为各种 YouTube 频道生成 youtubepartner-channel-audit scope 的方法。

您遇到的error是指:

The OAuth 2.0 token provided for the request specifies scopes that are insufficient for accessing the requested data.

您可以request for authorization of auditDetails获取频道资源:

Must provide an authorization token that contains the https://www.googleapis.com/auth/youtubepartner-channel-audit scope. In addition, any token that uses that scope must be revoked when the MCN decides to accept or reject the channel or within two weeks of the date that the token was issued.

之后,您可以将您的范围添加到 OAuth 登录请求。

为了引入 scopes, an authorization token 包含需要创建的范围。

可以通过 API 控制台中的 Credentials page 创建授权凭据。

Create credentials

但在创建 OAuth 客户端 ID 授权凭据之前,用户需要在 consent screen.

上设置产品名称

consent screen 上,用户可以根据应用程序要求添加多个 范围

Add scope