LiveChatMessages: transition
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
YouTube チャット メッセージのステータスを移行し、新しいステータスに関連するすべてのプロセスを開始します。たとえば、ライブ アンケートのステータスを closed
に移行すると、YouTube はそのメッセージのアンケートを終了します。このメソッドを呼び出す前に、ライブ アンケート メッセージの status
プロパティの値が active
であることを確認する必要があります。
リクエスト
HTTP リクエスト
POST https://www.googleapis.com/youtube/v3/liveChatMessages/transition
承認
このリクエストは、少なくとも次のうち 1 つのスコープでの承認が必要です(認証と承認の詳細をご確認ください)。
スコープ |
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 のリクエストとレスポンスを確認します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-08-08 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-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,[]]