SuperChatEvents: list
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
常見用途
要求
HTTP 要求
GET https://www.googleapis.com/youtube/v3/superChatEvents
授權
這項要求需要至少具備下列其中一個範圍的授權。如要進一步瞭解驗證和授權,請參閱「實作 OAuth 2.0 驗證」。
範圍 |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
https://www.googleapis.com/auth/youtube.readonly |
參數
下表列出這項查詢支援的參數。列出的所有參數都是查詢參數。
參數 |
必要參數 |
part |
string
part 參數會指定 API 回應中要包含的 superChatEvent 資源部分。支援的值為 id 和 snippet 。 |
選用參數 |
hl |
string
hl 參數會指示 API 伺服器依特定語言的慣例,設定 snippet.displayString 屬性值的格式,以便顯示超級聊天的購買金額和幣別。參數值必須是 i18nLanguages.list 方法傳回清單中的語言代碼。預設值為 en ,這表示預設行為會將顯示字串格式化為英文。舉例來說,根據預設,字串的格式為 $1.00 ,而非 $1,00 。 |
maxResults |
unsigned integer
maxResults 參數會指定結果集應傳回的項目數量上限。可接受的值介於 1 到 50 (包含這兩者) 之間。預設值為 5 。 |
pageToken |
string
pageToken 參數會在結果集中標示應傳回的特定網頁。在 API 回應中,nextPageToken 和 prevPageToken 屬性會標示可擷取的其他網頁。 |
回應
如果成功的話,這個方法會傳回回應內文,其結構如下:
{
"kind": "youtube#superChatEventListResponse",
"etag": etag,
"nextPageToken": string,
"pageInfo": {
"totalResults": integer,
"resultsPerPage": integer
},
"items": [
superChatEvent resource
]
}
屬性
下表定義了這個資源中顯示的屬性:
屬性 |
kind |
string
識別 API 資源的類型。值為 youtube#superChatEventListResponse 。 |
etag |
etag
這項資源的 Etag。 |
nextPageToken |
string
可用於做為 pageToken 參數值的符記,用於擷取結果集的下一頁。 |
pageInfo |
object
pageInfo 物件封裝結果集的分頁資訊。 |
pageInfo.totalResults |
integer
結果集中的結果總數。 |
pageInfo.resultsPerPage |
integer
API 回應中包含的結果數量。 |
items[] |
list
符合要求條件的超級留言購買交易清單。 |
錯誤
下表列出 API 在回應對此方法的呼叫時可能傳回的錯誤訊息。詳情請參閱錯誤訊息說明文件。
錯誤類型 |
錯誤詳細資料 |
說明 |
forbidden (403) |
insufficientPermissions |
要求未獲得適當授權,無法擷取超級留言事件。 |
試試看!
使用 APIs Explorer 呼叫此 API,並查看 API 要求和回應。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-16 (世界標準時間)。
[null,null,["上次更新時間:2024-11-16 (世界標準時間)。"],[],[],null,["# SuperChatEvents: list\n\nList Super Chat events from a channel's live streams in the previous 30 days.\n\nCommon use cases\n----------------\n\nThe list below shows common use cases for this method. Hover over a use case to see its description, or click on a use case to load sample parameter values in the APIs Explorer. You can open the [fullscreen APIs Explorer](#) to see code samples that dynamically update to reflect the parameter values entered in the Explorer.\n\nThe table below shows common use cases for this method. You can click on a use case name to load sample parameter values in the APIs Explorer. Or you can see code samples for a use case in the fullscreen APIs Explorer by clicking on the code icon below a use case name. In the fullscreen UI, you can update parameter and property values and the code samples will dynamically update to reflect the values you enter. \nThis method has one common use case, which is described below. The buttons below the description populate the APIs Explorer with sample values or open the fullscreen APIs Explorer to show code samples that use those values. The code samples also dynamically update if you change the values.\n\n\u003cbr /\u003e\n\nRequest\n-------\n\n### HTTP request\n\n```\nGET https://www.googleapis.com/youtube/v3/superChatEvents\n```\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes. To read more about authentication and authorization, see [Implementing OAuth 2.0 authentication](/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| `https://www.googleapis.com/auth/youtube.readonly` |\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| `part` | `string` The **part** parameter specifies the `superChatEvent` resource parts that the API response will include. Supported values are `id` and `snippet`. |\n| **Optional parameters** |||\n| `hl` | `string` The **hl** parameter instructs the API server to format the [snippet.displayString](/youtube/v3/live/docs/superChatEvents#snippet.displayString) property value, which shows the purchase amount and currency of a Super Chat, according to the conventions of a particular language. The parameter value must be a language code included in the list returned by the [i18nLanguages.list](/youtube/v3/docs/i18nLanguages/list) method. The default value is `en`, which means that the default behavior is to format display strings as they would be used in English. For example, by default, a string is formatted as `$1.00` rather than `$1,00`. |\n| `maxResults` | `unsigned integer` The **maxResults** parameter specifies the maximum number of items that should be returned in the result set. Acceptable values are `1` to `50`, inclusive. The default value is `5`. |\n| `pageToken` | `string` The **pageToken** parameter identifies a specific page in the result set that should be returned. In an API response, the `nextPageToken` and `prevPageToken` properties identify other pages that could be retrieved. |\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 response body with the following structure: \n\n```objective-c\n{\n \"kind\": \"youtube#superChatEventListResponse\",\n \"etag\": etag,\n \"nextPageToken\": string,\n \"pageInfo\": {\n \"totalResults\": integer,\n \"resultsPerPage\": integer\n },\n \"items\": [\n superChatEvent resource\n ]\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|---------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies the API resource's type. The value will be `youtube#superChatEventListResponse`. |\n| `etag` | `etag` The Etag of this resource. |\n| `nextPageToken` | `string` The token that can be used as the value of the `pageToken` parameter to retrieve the next page in the result set. |\n| `pageInfo` | `object` The `pageInfo` object encapsulates paging information for the result set. |\n| pageInfo.`totalResults` | `integer` The total number of results in the result set. |\n| pageInfo.`resultsPerPage` | `integer` The number of results included in the API response. |\n| `items[]` | `list` A list of Super Chat purchases that match the request criteria. |\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)` | `insufficientPermissions` | The request is not properly authorized to retrieve Super Chat events. |\n\nTry it!\n-------\n\nUse the APIs Explorer to call this API and see the API request and response."]]