Resource: Subscription
A subscription resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.
| JSON representation |
|---|
{ "kind": string, "etag": string, "id": string, "snippet": { "publishedAt": string, "title": string, "description": string, "resourceId": { "kind": string, "videoId": string, "channelId": string, "playlistId": string }, "channelId": string, "thumbnails": { object ( |
| Fields | |
|---|---|
kind |
Output only. Identifies what kind of resource this is. Value: the fixed string |
etag |
Output only. Etag of this resource. |
id |
Output only. The ID that YouTube uses to uniquely identify the subscription. |
snippet |
The |
snippet.publishedAt |
Output only. The date and time that the subscription was created. The value is specified in ISO 8601 format. |
snippet.title |
Output only. The subscription's title. |
snippet.description |
Output only. The subscription's details. |
snippet.resourceId |
The For subscriptions, |
snippet.resourceId.kind |
The type of the API resource. |
snippet.resourceId.videoId |
The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the |
snippet.resourceId.channelId |
The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the |
snippet.resourceId.playlistId |
The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the |
snippet.channelId |
The ID that YouTube uses to uniquely identify the subscriber's channel. The |
snippet.thumbnails |
Output only. A map of thumbnail images associated with the subscribed channel. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains the image URL. Subscriptions populate only the |
contentDetails |
The |
contentDetails.totalItemCount |
Output only. The approximate number of items that the subscription points to. |
contentDetails.newItemCount |
Output only. The number of new items in the subscription since its content was last read. |
contentDetails.activityType |
The type of activity this subscription is for: Valid values of this enum field are:
|
subscriberSnippet |
Output only. The |
subscriberSnippet.title |
Output only. The title of the subscriber's channel. |
subscriberSnippet.description |
Output only. The description of the subscriber's channel. |
subscriberSnippet.channelId |
Output only. The ID that YouTube assigns to uniquely identify the subscriber's channel. |
subscriberSnippet.thumbnails |
Output only. Thumbnail images for the subscriber's channel. Subscriptions populate only the |
Methods |
|
|---|---|
|
Deletes a subscription. |
|
Adds a subscription for the authenticated user's channel. |
|
Returns subscription resources that match the API request criteria. |