LiveChatMessages: transition
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
YouTube पर लाइव चैट में मैसेज के स्टेटस में बदलाव करता है और नई स्थिति से जुड़ी प्रोसेस शुरू करता है. उदाहरण के लिए, जब किसी लाइव पोल की स्थिति को closed
में बदला जाता है, तो YouTube उस मैसेज के पोल को बंद कर देता है. इस तरीके को कॉल करने से पहले, पक्का करें कि लाइव पोल मैसेज के लिए status
प्रॉपर्टी की वैल्यू active
हो.
अनुरोध
एचटीटीपी अनुरोध
POST https://www.googleapis.com/youtube/v3/liveChatMessages/transition
पैरामीटर
नीचे दी गई टेबल में ऐसे पैरामीटर दिए गए हैं जो इस क्वेरी के साथ काम करते हैं. सूची में दिए गए सभी पैरामीटर, क्वेरी पैरामीटर हैं.
पैरामीटर |
ज़रूरी पैरामीटर |
id |
string
id पैरामीटर उस मैसेज का यूनीक आईडी बताता है जिसका स्टेटस दूसरे स्टेटस में बदला जा रहा है. |
status |
enum
status पैरामीटर से उस स्थिति की पहचान होती है जहां मैसेज बदला जा रहा है. किसी मैसेज को closed स्थिति में ले जाने के लिए, उस पोल के लिए status का active होना ज़रूरी है जिस पर वह मैसेज लागू होता है.
आप सिर्फ़ closed पर ट्रांसफ़र कर सकते हैं. इसका मतलब है कि पोल बंद हो गया है.
|
वैकल्पिक पैरामीटर |
part |
string
part पैरामीटर में, liveChatMessage संसाधन के ऐसे हिस्से तय किए जाते हैं जो एपीआई के रिस्पॉन्स में शामिल होते हैं. id , snippet , और authorDetails को वैल्यू के तौर पर इस्तेमाल किया जा सकता है.
जवाब के मुख्य भाग में आखिरी पोल का नतीजा पाने के लिए, पैरामीटर की वैल्यू को snippet पर सेट करें.
|
अनुरोध का मुख्य भाग
इस तरीके का इस्तेमाल करते समय अनुरोध का मुख्य हिस्सा न भेजें.
गड़बड़ियां
नीचे दी गई टेबल में उन गड़बड़ी के मैसेज की पहचान की गई है जिन्हें एपीआई इस तरीके का इस्तेमाल करने पर जवाब में लौटा सकता है. ज़्यादा जानकारी के लिए, गड़बड़ी का मैसेज वाला दस्तावेज़ देखें.
गड़बड़ी का टाइप |
गड़बड़ी विवरण |
ब्यौरा |
forbidden (403) |
forbidden |
आपके पास इस मैसेज के स्टेटस को ट्रांसफ़र करने की ज़रूरी अनुमतियां नहीं हैं. |
required (400) |
idRequired |
ज़रूरी id पैरामीटर को उस मैसेज की पहचान करनी चाहिए जिसकी स्थिति को ट्रांसफ़र करना है. |
required (400) |
statusRequired |
एपीआई अनुरोध में, status पैरामीटर के लिए एक वैल्यू तय होनी चाहिए. |
notFound (404) |
liveChatMessagesNotFound |
id पैरामीटर से तय किया गया मैसेज मौजूद नहीं है. |
forbidden (403) |
modificationNotAllowed |
बताए गए liveChatMessage संसाधन की स्थिति को ट्रांसफ़र नहीं किया जा सकता. id पैरामीटर किसी ऐसे मैसेज की पहचान कर सकता है जिसकी स्थिति का ट्रांज़िशन नहीं किया जा सकता. |
इसे आज़माएं!
इस एपीआई को कॉल करने के लिए, APIs Explorer का इस्तेमाल करें. साथ ही, एपीआई का अनुरोध और रिस्पॉन्स देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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."]]