資源:留言
comment 資源包含影片或貼文的單一 YouTube 留言資訊。留言可以是頂層留言,也可以是對頂層留言的回覆。
貼文留言功能目前處於前測階段,僅限特定發布合作夥伴 (已核准的 Google Cloud 專案) 使用。我們預計在 2027 年正式發布,屆時將開放更多公開 API 存取權。
| JSON 表示法 |
|---|
{
"kind": string,
"etag": string,
"id": string,
"snippet": {
"channelId": string,
"videoId": string,
"postId": string,
"textDisplay": string,
"textOriginal": string,
"parentId": string,
"authorDisplayName": string,
"authorProfileImageUrl": string,
"authorChannelUrl": string,
"authorChannelId": {
"value": string
},
"canRate": boolean,
"viewerRating": enum,
"likeCount": integer,
"moderationStatus": enum ( |
| 欄位 | |
|---|---|
kind |
識別這是哪種資源。值:固定字串 |
etag |
這項資源的 Etag。 |
id |
YouTube 用來識別留言的專屬 ID。 |
snippet |
|
snippet.channelId |
與留言相關聯的 YouTube 頻道 ID (留言所屬影片或貼文的頻道)。 |
snippet.videoId |
留言提及的影片 ID (如有)。 API 只會針對 |
snippet.postId |
留言所指的貼文 ID (如有)。 API 只會針對 |
snippet.textDisplay |
留言文字,格式為 HTML 或純文字,視 |
snippet.textOriginal |
留言最初發布或上次更新時的原始文字。 |
snippet.parentId |
上層頂層留言的專屬 ID。只有在留言是回覆其他留言時,才會設定這個屬性。 |
snippet.authorDisplayName |
留言者的顯示名稱。 |
snippet.authorProfileImageUrl |
留言者顯示圖片的網址。 |
snippet.authorChannelUrl |
留言作者的 YouTube 頻道網址 (如有)。 |
snippet.authorChannelId |
封裝留言作者 YouTube 頻道的相關資訊 (如有)。 |
snippet.authorChannelId.value |
留言作者的 YouTube 頻道 ID (如有)。 |
snippet.canRate |
指出檢視者是否能對留言評分。 |
snippet.viewerRating |
檢視者對這則留言的評分。 這個列舉欄位的有效值如下:
|
snippet.likeCount |
留言獲得的喜歡 (正面評價) 總數。 |
snippet.moderationStatus |
留言的管理狀態。只要傳回的留言留待審核 ( |
snippet.publishedAt |
留言最初發布的日期和時間。這個值是以 ISO 8601 格式指定。 |
snippet.updatedAt |
上次更新留言的日期和時間。這個值是以 ISO 8601 格式指定。 |
snippet.imageUrl |
僅供輸出。留言中附加的圖片或 GIF 動畫網址 (如有)。只有在留言包含圖片或 GIF 時,才會顯示這項屬性。網址會以已簽署連結的形式提供,存留時間 (TTL) 為六小時,並在擷取後六小時到期。 |
方法 |
|
|---|---|
|
刪除留言。 |
|
建立現有留言的回覆。 |
|
傳回符合 API 要求參數的留言清單。 |
|
設定一或多則留言的管理狀態。 |
|
修改留言。 |