无法通过 API 删除对 Youtube 视频的评论
Cannot delete comment on Youtube video via API
我正在尝试删除 this video but the response code is 400. I'm using token of the channel's admin with https://www.googleapis.com/auth/youtube.force-ssl scope as it required by documentation 上的以下评论 z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo。
请求是:
DELETE https://www.googleapis.com/youtube/v3/comments?id=z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo&alt=json
{
"query_params": {
"id": "z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo",
"alt": "json"
}
}
回复:
{
"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."
}
}
请求有什么问题?
这是令牌调试信息:
{
issued_to: "493985796851.apps.googleusercontent.com",
audience: "493985796851.apps.googleusercontent.com",
user_id: "109704411339866376304",
scope: "https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload",
expires_in: 2452,
access_type: "offline"
}
您无法删除评论的原因是您正在使用 Comments.delete 删除其他用户撰写的评论。 Comments.delete
只会删除您自己在视频中的评论。
要删除其他用户的评论,请使用 Comments.setModerationStatus 并将 moderationStatus 设置为“rejected
”。
因此,只需重复您所做的,但这次使用 Comments.setModerationStatus
。 link 中有用于测试目的的试用。
我正在尝试删除 this video but the response code is 400. I'm using token of the channel's admin with https://www.googleapis.com/auth/youtube.force-ssl scope as it required by documentation 上的以下评论 z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo。
请求是:
DELETE https://www.googleapis.com/youtube/v3/comments?id=z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo&alt=json
{
"query_params": {
"id": "z12mdhjgxrfgtpf3d231jrz5vo3jdj0lo",
"alt": "json"
}
}
回复:
{
"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."
}
}
请求有什么问题?
这是令牌调试信息:
{
issued_to: "493985796851.apps.googleusercontent.com",
audience: "493985796851.apps.googleusercontent.com",
user_id: "109704411339866376304",
scope: "https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/youtube.force-ssl https://www.googleapis.com/auth/youtube.upload",
expires_in: 2452,
access_type: "offline"
}
您无法删除评论的原因是您正在使用 Comments.delete 删除其他用户撰写的评论。 Comments.delete
只会删除您自己在视频中的评论。
要删除其他用户的评论,请使用 Comments.setModerationStatus 并将 moderationStatus 设置为“rejected
”。
因此,只需重复您所做的,但这次使用 Comments.setModerationStatus
。 link 中有用于测试目的的试用。