LiveChatMessages: transition
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
YouTube 실시간 채팅 메시지의 상태를 전환하고 새 상태와 관련된 모든 프로세스를 시작합니다. 예를 들어 실시간 설문조사 상태를 closed
로 전환하면 YouTube에서 메시지의 설문조사를 종료합니다. 이 메서드를 호출하기 전에 실시간 설문조사 메시지의 status
속성 값이 active
인지 확인해야 합니다.
요청
HTTP 요청
POST https://www.googleapis.com/youtube/v3/liveChatMessages/transition
승인
이 요청에는 다음 범위 중 최소 하나를 사용하여 인증이 필요합니다. (인증 및 승인에 대해 자세히 알아보기)
범위 |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
매개변수
다음 표에는 이 쿼리가 지원하는 매개변수가 나와 있습니다. 나열된 모든 매개변수는 쿼리 매개변수입니다.
매개변수 |
필수 매개변수 |
id |
string
id 매개변수는 다른 상태로 전환되는 메시지의 고유 ID를 지정합니다. |
status |
enum
status 매개변수는 메시지가 변경되는 상태를 식별합니다. 메시지를 closed 상태로 전환하려면 메시지가 바인딩된 설문조사의 status 가 active 여야 합니다.
closed (으)로만 전환할 수 있으며, 이는 설문조사가 종료됨을 의미합니다.
|
선택적 매개변수 |
part |
string
part 매개변수는 API 응답이 포함할 liveChatMessage 리소스 부분을 지정합니다. 지원되는 값은 id , snippet , authorDetails 입니다.
응답 본문에서 최종 폴 결과를 가져오려면 매개변수 값을 snippet 로 설정합니다.
|
요청 본문
이 메소드를 호출할 때 요청 본문을 제공하지 마세요.
오류
다음 표에서는 이 메서드에 대한 호출에 대한 응답으로 API가 반환할 수 있는 오류 메시지를 식별합니다. 자세한 내용은 오류 메시지 설명서를 참조하세요.
오류 유형 |
오류 세부정보 |
설명 |
forbidden (403) |
forbidden |
지정한 메시지의 상태를 전환하는 데 필요한 권한이 없습니다. |
required (400) |
idRequired |
필수 id 매개변수는 상태를 전환하려는 메시지를 식별해야 합니다. |
required (400) |
statusRequired |
API 요청에서 status 매개변수의 값을 지정해야 합니다. |
notFound (404) |
liveChatMessagesNotFound |
id 매개변수로 지정된 메시지가 존재하지 않습니다. |
forbidden (403) |
modificationNotAllowed |
지정된 liveChatMessage 리소스의 상태를 전환할 수 없습니다. id 매개변수는 상태를 전환할 수 없는 메시지를 식별할 수 있습니다. |
사용해 보기
APIs Explorer를 사용하여 이 API를 호출하고 API 요청 및 응답을 확인합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-08-08(UTC)
[null,null,["최종 업데이트: 2024-08-08(UTC)"],[[["\u003cp\u003eThis API endpoint transitions the status of a YouTube live chat message, such as closing an active poll.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires authorization and must include the message's unique \u003ccode\u003eid\u003c/code\u003e and the new \u003ccode\u003estatus\u003c/code\u003e (\u003ccode\u003eclosed\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epart\u003c/code\u003e parameter, which is optional, specifies which parts of the \u003ccode\u003eliveChatMessage\u003c/code\u003e resource to include in the API response (e.g. \u003ccode\u003esnippet\u003c/code\u003e, \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003eauthorDetails\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eSuccessful calls to this API will return a \u003ccode\u003eliveChatMessages\u003c/code\u003e resource in the response body, detailing the message's new status.\u003c/p\u003e\n"],["\u003cp\u003eCommon errors include \u003ccode\u003eforbidden\u003c/code\u003e for permission issues, \u003ccode\u003erequired\u003c/code\u003e for missing parameters, \u003ccode\u003enotFound\u003c/code\u003e if the message ID doesn't exist, and \u003ccode\u003emodificationNotAllowed\u003c/code\u003e if the specified message's status can't be changed.\u003c/p\u003e\n"]]],["This API endpoint, `liveChatMessages/transition`, changes a YouTube live chat message's status and triggers related actions. It requires the message's `id` and the target `status`, which can only be `closed`. The `status` of the poll must be `active` to proceed with the transition. The request is a `POST` method without a request body. Authorization scopes `youtube` or `youtube.force-ssl` are needed. Upon success, a `liveChatMessages` resource is returned, and errors include `forbidden`, `required`, and `notFound`.\n"],null,["# LiveChatMessages: transition\n\nTransitions the status of a YouTube live chat message and initiates any processes associated with the new status. For example, when you transition a live poll's status to `closed`, YouTube ends that message's poll. Before calling this method, you should confirm that the value of the [status](/youtube/v3/live/docs/liveChatMessages#snippet.pollDetails.metadata.status) property for the live poll message is `active`.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/youtube/v3/liveChat/messages/transition\n```\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/youtube/v3/live/authentication)).\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/youtube` |\n| `https://www.googleapis.com/auth/youtube.force-ssl` |\n\n### Parameters\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 the unique ID of the message that is transitioning to another status. |\n| `status` | `enum` The **status** parameter identifies the state to which the message is changing. To transition a message to the `closed` state, the [status](/youtube/v3/live/docs/liveChatMessages#snippet.pollDetails.metadata.status) must be `active` for the poll that the message is bound to. \u003cbr /\u003e You can only transition to **closed**, meaning that the poll is closed. |\n| **Optional parameters** |||\n| `part` | `string` The **part** parameter specifies the `liveChatMessage` resource parts that the API response will include. Supported values are `id`, `snippet`, and `authorDetails`. \u003cbr /\u003e Set the parameter value to `snippet` to get the final poll result in the response body. |\n\n### Request body\n\nDo not provide a request body when calling this method.\n\nResponse\n--------\n\nIf successful, this method returns a [liveChatMessages resource](/youtube/v3/live/docs/liveChatMessages#resource) in the response body.\n\nErrors\n------\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/live/docs/errors) documentation for more detail.\n\n| Error type | Error detail | Description |\n|-------------------|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `forbidden (403)` | `forbidden` | You don't have the permissions required to transition the status of the specified message. |\n| `required (400)` | `idRequired` | The required `id` parameter must identify the message whose status you want to transition. |\n| `required (400)` | `statusRequired` | The API request must specify a value for the `status` parameter. |\n| `notFound (404)` | `liveChatMessagesNotFound` | The message specified by the `id` parameter does not exist. |\n| `forbidden (403)` | `modificationNotAllowed` | The status of the specified `liveChatMessage` resource cannot be transitioned. The `id` parameter might identify a message whose status cannot be transitioned. |\n\nTry it!\n-------\n\nUse the APIs Explorer to call this API and see the API request and response."]]