首页 > 解决方案 > youtube-v3-api setModerationStatus 没有将其从拒绝更改为已发布

问题描述

根据 Youtube API 文档,此端点无法正常运行。

我可以将 moderationStatus 设置为已发布

然后将 moderationStatus 设置为被拒绝,没有任何问题

但我无法将其从拒绝更改为其他任何内容,它总是返回:

{
 "error": {
  "errors": [
   {
    "domain": "youtube.comment",
    "reason": "processingFailure",
    "message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the requests input is invalid.",
    "locationType": "parameter",
    "location": "id"
   }
  ],
  "code": 400,
  "message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the requests input is invalid."
 }
}

我从 Google 的官方 PHP 库、youtube API 控制台和 CURL 中得到了同样的错误。

更新 - HTTP 请求示例:

POST /youtube/v3/comments/setModerationStatus?id=UgyxQJSR-xEMmAWJDjZ4AaABAg&moderationStatus=published HTTP/1.1
Authorization: Bearer {MY_VALID_ACCESS_TOKEN}
Content-Length: 0
Host: www.googleapis.com
Content-Type: application/json

HTTP/1.1 400
status: 400
access-control-allow-credentials: true
access-control-allow-origin: chrome-extension://aejoelaoggembcahagimdiliamlcdmfm
vary: Origin
vary: X-Origin
content-type: application/json; charset=UTF-8
content-encoding: gzip
access-control-expose-headers: Content-Encoding,Content-Length,Content-Type,Date,Server,Vary,X-Google-GFE-Backend-Request-Cost
date: Thu, 31 May 2018 15:54:36 GMT
expires: Thu, 31 May 2018 15:54:36 GMT
cache-control: private, max-age=0
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
content-length: 245
server: GSE
alt-svc: quic=":443"; ma=2592000; v="43,42,41,39,35"

标签: youtube-data-api

解决方案


同样的问题,我创建了一个问题:https ://issuetracker.google.com/issues/79958369


推荐阅读