YouTube注释API:注释插入403权限不足

问题描述:

这就是我用来向youtube添加评论的方法:

This is what im using to add comments to youtube :

gapi.client.youtube.commentThreads.insert({
          part: "snippet", commentData
        }).then(function (response) {
          console.log("response", response);
    })

这就是我被击中时得到的:

This is what im getting while hit that :

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "insufficientPermissions",
    "message": "Insufficient Permission: Request had insufficient authentication scopes."
   }
  ],
  "code": 403,
  "message": "Insufficient Permission: Request had insufficient authentication scopes."
 }
}

权限不足:请求的身份验证范围不足.

Insufficient Permission: Request had insufficient authentication scopes.

完全意味着当前已通过身份验证的用户尚未授予您执行此操作的权限.

Means exactly that the currently authenticated user has not granted you the permissions to do that.

如果您查看文档 comments.insert ,则会看到为了使用此方法,您必须使用https://www.googleapis.com/auth/youtube.force-ssl范围

If you check the documentation comments.insert you will see that in order to use this method you must have authncated your user with the https://www.googleapis.com/auth/youtube.force-ssl scope