YouTube에서 Shorts 동영상의 조회수를 집계하는 방식에 맞게 Data API를 업데이트하고 있습니다.
자세히 알아보기
Comments: setModerationStatus
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
하나 이상의 댓글의 검토 상태를 설정합니다. API 요청은 댓글과 연결된 채널 또는 동영상의 소유자가 승인해야 합니다.
할당량 영향: 이 메서드를 호출하면 50단위의 할당량 비용이 발생합니다.
일반적인 사용 사례
요청
HTTP 요청
POST https://www.googleapis.com/youtube/v3/comments/setModerationStatus
승인
이 요청에는 다음 범위 중 최소 하나를 사용하여 인증이 필요합니다. (인증 및 승인에 대해 자세히 알아보기)
범위 |
https://www.googleapis.com/auth/youtube.force-ssl |
매개변수
다음 표에는 이 쿼리가 지원하는 매개변수가 나와 있습니다. 나열된 모든 매개변수는 쿼리 매개변수입니다.
매개변수 |
필수 매개변수 |
id |
string
id 매개변수는 검토 상태를 업데이트하는 댓글을 식별하는 쉼표로 구분된 ID 목록을 지정합니다. |
moderationStatus |
string
지정된 댓글의 새 검토 상태를 식별합니다.
허용되는 값은 다음과 같습니다.
heldForReview - 댓글을 운영자의 검토 대기 중으로 표시합니다.
published – 공개 표시를 위한 주석을 지웁니다.
rejected - 표시에 부적합한 댓글을 거부합니다. 이렇게 하면 거부된 댓글에 대한 모든 답글이 사실상 숨겨집니다.
|
선택적 매개변수 |
banAuthor |
boolean
banAuthor 매개변수를 사용하면 댓글 작성자가 작성한 추가 댓글을 자동으로 거부하도록 지정할 수 있습니다. 작성자를 차단하려면 매개변수 값을 true 로 설정합니다.
참고: 이 매개변수는 moderationStatus 매개변수도 rejected 로 설정된 경우에만 유효합니다. |
요청 본문
이 메소드를 호출할 때 요청 본문을 제공하지 마세요.
응답
성공하면 이 메서드는 HTTP 204
응답 코드 (No Content
)를 반환합니다.
오류
다음 표에서는 이 메서드에 대한 호출에 대한 응답으로 API가 반환할 수 있는 오류 메시지를 식별합니다. 자세한 내용은 오류 메시지 설명서를 참조하세요.
사용해 보기
APIs Explorer를 사용하여 이 API를 호출하고 API 요청 및 응답을 확인합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-04-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-04-26(UTC)"],[],[],null,["Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments.\n\n**Quota impact:** A call to this method has a [quota cost](/youtube/v3/getting-started#quota) of 50 units.\n\nCommon use cases\n\nThe list below shows common use cases for this method. Hover over a use case to see its description, or click on a use case to load sample parameter values in the APIs Explorer. You can open the [fullscreen APIs Explorer](#) to see code samples that dynamically update to reflect the parameter values entered in the Explorer.\n\nThe table below shows common use cases for this method. You can click on a use case name to load sample parameter values in the APIs Explorer. Or you can see code samples for a use case in the fullscreen APIs Explorer by clicking on the code icon below a use case name. In the fullscreen UI, you can update parameter and property values and the code samples will dynamically update to reflect the values you enter. \nThis method has one common use case, which is described below. The buttons below the description populate the APIs Explorer with sample values or open the fullscreen APIs Explorer to show code samples that use those values. The code samples also dynamically update if you change the values.\n\n\u003cbr /\u003e\n\nRequest\n\nHTTP request \n\n```\nPOST https://www.googleapis.com/youtube/v3/comments/setModerationStatus\n```\n\nAuthorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/youtube/v3/guides/authentication)).\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/youtube.force-ssl` |\n\nParameters\n\nThe following table lists the parameters that this query supports. All of the parameters listed are query parameters.\n\n| Parameters ||\n|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| **Required parameters** |||\n| `id` | `string` The **id** parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status. |\n| `moderationStatus` | `string` Identifies the new moderation status of the specified comments. Acceptable values are: - **heldForReview** -- Marks a comment as awaiting review by a moderator. - **published** -- Clears a comment for public display. - **rejected** -- Rejects a comment as being unfit for display. This action also effectively hides all replies to the rejected comment. |\n| **Optional parameters** |||\n| `banAuthor` | `boolean` The **banAuthor** parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to `true` to ban the author. **Note:** This parameter is only valid if the [moderationStatus](#moderationStatus) parameter is also set to `rejected`. |\n\nRequest body\n\nDo not provide a request body when calling this method.\n\nResponse\n\nIf successful, this method returns an HTTP `204` response code (`No Content`).\n\nErrors\n\nThe following table identifies error messages that the API could return in response to a call to this method. Please see the [error message](/youtube/v3/docs/errors) documentation for more detail.\n\n| Error type | Error detail | Description |\n|--------------------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `badRequest (400)` | `banWithoutReject` | The `banAuthor` parameter can only be used if the `moderationStatus` parameter value is `rejected`. |\n| `badRequest (400)` | `operationNotSupported` | Comments not based on Google+ offer only limited moderation functionality. |\n| `badRequest (400)` | `processingFailure` | The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the request's input is invalid. |\n| `forbidden (403)` | `forbidden` | The moderation status of one or more comments cannot be set due to insufficient permissions. The request might not be properly authorized. |\n| `notFound (404)` | `commentNotFound` | One or more of the comments that the request is trying to update cannot be found. Check the values of the request's [id](/youtube/v3/docs/comments/setModerationStatus#id) parameter to ensure that they are correct. |\n\nTry it!\n\nUse the APIs Explorer to call this API and see the API request and response."]]