YouTubePHP Documentation

ChannelsApi extends AbstractApi
in package

FinalYes

This file is generated from spec/discovery.json (YouTube Data API v3, revision 20260924) by tools/generate.php. Do not edit it by hand - run `composer spec:build` instead.

Channels, the signed-in account's own included.

Reach it as $youtube->channels. Every method takes the parameters Google documents, by the same names: use named arguments for the optional ones.

Tags
link
https://developers.google.com/youtube/v3/docs/channels
since
1.0.0

Table of Contents

Properties

$youtube  : YouTube

Methods

__construct()  : mixed
list()  : PromiseInterface<string|int, ChannelListResponse>
Retrieves a list of resources, possibly filtered.
update()  : PromiseInterface<string|int, Channel>
Updates an existing resource.
call()  : PromiseInterface<string|int, mixed>
streamed()  : PromiseInterface<string|int, ResponseStream>
Opens a server-streamed call and reads its body as it arrives.

Properties

Methods

list()

Retrieves a list of resources, possibly filtered.

public list(array<int, string>|string $part[, string|null $categoryId = null ][, string|null $forHandle = null ][, string|null $forUsername = null ][, string|null $hl = null ][, array<int, string>|string|null $id = null ][, bool|null $managedByMe = null ][, int|null $maxResults = null ][, bool|null $mine = null ][, bool|null $mySubscribers = null ][, string|null $onBehalfOfContentOwner = null ][, string|null $pageToken = null ]) : PromiseInterface<string|int, ChannelListResponse>

Costs 1 unit of quota.

Parameters
$part : array<int, string>|string

The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties.

$categoryId : string|null = null

Return the channels within the specified guide category ID.

$forHandle : string|null = null

Return the channel associated with a YouTube handle.

$forUsername : string|null = null

Return the channel associated with a YouTube username.

$hl : string|null = null

Stands for "host language". Specifies the localization language of the metadata to be filled into snippet.localized. The field is filled with the default metadata if there is no localization in the specified language. The parameter value must be a language code included in the list returned by the i18nLanguages.list method (e.g. en_US, es_MX).

$id : array<int, string>|string|null = null

Return the channels with the specified IDs.

$managedByMe : bool|null = null

Return the channels managed by the authenticated user.

$maxResults : int|null = null

The maxResults parameter specifies the maximum number of items that should be returned in the result set. From 0 to 50. YouTube assumes 5 when it is left out.

$mine : bool|null = null

Return the ids of channels owned by the authenticated user.

$mySubscribers : bool|null = null

Return the channels subscribed to the authenticated user

$onBehalfOfContentOwner : string|null = null

Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.

$pageToken : string|null = null

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.

Tags
link
https://developers.google.com/youtube/v3/docs/channels/list
since
1.0.0
Return values
PromiseInterface<string|int, ChannelListResponse>

update()

Updates an existing resource.

public update(array<int, string>|string $part, Channel|array<string, mixed> $body[, string|null $onBehalfOfContentOwner = null ]) : PromiseInterface<string|int, Channel>

Costs 50 units of quota.

Parameters
$part : array<int, string>|string

The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.) Note that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies.

$body : Channel|array<string, mixed>

The Channel to send.

$onBehalfOfContentOwner : string|null = null

The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. This parameter must be provided if the request is authenticated with credentials for a CMS content owner user acting on a managed channel. If omitted, the request executes under the authenticated user's direct context and returns an HTTP 403 Forbidden error.

Tags
link
https://developers.google.com/youtube/v3/docs/channels/update
since
1.0.0
Return values
PromiseInterface<string|int, Channel>

call()

protected call(string $endpoint, string $method, string $path[, array<string, mixed> $query = [] ][, array<string, mixed>|JsonSerializable|null $body = null ][, string|null $returns = null ][, ?Media $media = null ][, ?string $uploadPath = null ][, bool $download = false ]) : PromiseInterface<string|int, mixed>
Parameters
$endpoint : string

The API method, e.g. liveChatMessages.list.

$method : string
$path : string
$query : array<string, mixed> = []
$body : array<string, mixed>|JsonSerializable|null = null
$returns : string|null = null

The type token the result hydrates as; null leaves it raw.

$media : ?Media = null
$uploadPath : ?string = null
$download : bool = false
Return values
PromiseInterface<string|int, mixed>

streamed()

Opens a server-streamed call and reads its body as it arrives.

protected streamed(string $endpoint, string $path, array<string, mixed> $query, string $returns) : PromiseInterface<string|int, ResponseStream>
Parameters
$endpoint : string
$path : string
$query : array<string, mixed>
$returns : string

The type token each element hydrates as.

Return values
PromiseInterface<string|int, ResponseStream>
On this page

Search results