Neelkanth Kaushik
Neelkanth Kaushik

Reputation: 245

YouTube API v3 returning 400 error when using pageToken

I am trying to get paginated comments on a video using following request:

https://www.googleapis.com/youtube/v3/commentThreads?part=snippet,replies&videoId=zB8byQHNHHg&maxResults=5&pageToken='2'&key=randomstring

But it is returning following response which shows 400 error:Screenshot of the response in console window.

What could be the reason as the official documentation states using pageToken for doing the same. https://developers.google.com/youtube/v3/docs/commentThreads/list#parameters

Anyone solved similar issue in the past? Please help.

Upvotes: 0

Views: 360

Answers (1)

daviddev38
daviddev38

Reputation: 33

The following table list the page along with the corresponding page token and total results. Note that you do not (need to) pass in a pageToken for the first page.

+------+------------+---------------+
| Page | Page Token | Total Results |
+------+------------+---------------+
|    1 | [none]     |          3628 |
|    2 | CDIQAA     |          3628 |
|    3 | CGQQAA     |          3626 |
|    4 | CJYBEAA    |          3626 |
|    5 | CMgBEAA    |          3625 |
|    6 | CPoBEAA    |          3625 |
|    7 | CKwCEAA    |          3625 |
|    8 | CN4CEAA    |          3624 |
|    9 | CJADEAA    |          3624 |
|   10 | CMIDEAA    |          3624 |
+------+------------+---------------+

Upvotes: 0

Related Questions