CommentThreadsApi
extends AbstractApi
in package
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.
Top-level comments, with their replies.
Reach it as $youtube->commentThreads. Every method takes the parameters Google
documents, by the same names: use named arguments for the optional ones.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- insert() : PromiseInterface<string|int, CommentThread>
- Inserts a new resource into this collection.
- list() : PromiseInterface<string|int, CommentThreadListResponse>
- Retrieves a list of resources, possibly filtered.
- call() : PromiseInterface<string|int, mixed>
- streamed() : PromiseInterface<string|int, ResponseStream>
- Opens a server-streamed call and reads its body as it arrives.
Properties
$youtube read-only
protected
YouTube
$youtube
Methods
__construct()
public
__construct(YouTube $youtube) : mixed
Parameters
- $youtube : YouTube
insert()
Inserts a new resource into this collection.
public
insert(array<int, string>|string $part, CommentThread|array<string, mixed> $body) : PromiseInterface<string|int, CommentThread>
Costs 50 units of quota.
Parameters
- $part : array<int, string>|string
-
The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.
- $body : CommentThread|array<string, mixed>
-
The CommentThread to send.
Tags
Return values
PromiseInterface<string|int, CommentThread>list()
Retrieves a list of resources, possibly filtered.
public
list(array<int, string>|string $part[, string|null $allThreadsRelatedToChannelId = null ][, string|null $channelId = null ][, array<int, string>|string|null $id = null ][, int|null $maxResults = null ][, string|null $moderationStatus = null ][, string|null $order = null ][, string|null $pageToken = null ][, string|null $searchTerms = null ][, string|null $textFormat = null ][, string|null $videoId = null ]) : PromiseInterface<string|int, CommentThreadListResponse>
Costs 1 unit of quota.
Parameters
- $part : array<int, string>|string
-
The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include.
- $allThreadsRelatedToChannelId : string|null = null
-
Returns the comment threads of all videos of the channel and the channel comments as well.
- $channelId : string|null = null
-
Returns the comment threads for all the channel comments (ie does not include comments left on videos).
- $id : array<int, string>|string|null = null
-
Returns the comment threads with the given IDs for Stubby or Apiary.
- $maxResults : int|null = null
-
The maxResults parameter specifies the maximum number of items that should be returned in the result set. From 1 to 100. YouTube assumes
20when it is left out. - $moderationStatus : string|null = null
-
Limits the returned comment threads to those with the specified moderation status. Not compatible with the 'id' filter. Valid values: published, heldForReview, likelySpam. One of
published,heldForReview,likelySpam,rejected. YouTube assumespublishedwhen it is left out. - $order : string|null = null
-
One of
orderUnspecified,time,relevance. YouTube assumestimewhen it is left out. - $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.
- $searchTerms : string|null = null
-
Limits the returned comment threads to those matching the specified key words. Not compatible with the 'id' filter.
- $textFormat : string|null = null
-
The requested text format for the returned comments. One of
textFormatUnspecified,html,plainText. YouTube assumeshtmlwhen it is left out. - $videoId : string|null = null
-
Returns the comment threads of the specified video.
Tags
Return values
PromiseInterface<string|int, CommentThreadListResponse>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.