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 מציין את המזהה הייחודי של ההודעה שעוברת לסטטוס אחר. |
status |
enum
הפרמטר status מזהה את המצב שבו ההודעה משתנה. כדי להעביר הודעה למצב closed , status צריך להיות active בסקר שאליו ההודעה קשורה.
אפשר לעבור רק אל closed , כלומר הסקר סגור.
|
פרמטרים אופציונליים |
part |
string
הפרמטר part מציין את חלקי המשאב liveChatMessage שתגובת ה-API תכלול. הערכים הנתמכים הם id , snippet ו-authorDetails .
צריך להגדיר את ערך הפרמטר כ-snippet כדי לקבל את התוצאה הסופית של הסקר בגוף התשובה.
|
גוף הבקשה
אין לספק גוף בקשה כשמבצעים קריאה ל-method הזה.
שגיאות
הטבלה הבאה מזהה את הודעות השגיאה שה-API יכול להחזיר בתגובה לקריאה ל-method הזה. אפשר לקרוא פרטים נוספים בתיעוד של הודעות שגיאה.
סוג השגיאה |
פרטי השגיאה |
תיאור |
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. 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,[]]