使用pageToken时,YouTube API v3返回400错误 [英] YouTube API v3 returning 400 error when using pageToken

查看:202
本文介绍了使用pageToken时,YouTube API v3返回400错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下请求在视频上获得分页评论:



官方文档声明使用 pageToken 做同样的事情。
https://developers.google.com/youtube/ v3 / docs / commentThreads / list#参数

过去有谁解决过类似的问题?请帮助。

解决方案

下表列出了页面以及相应的页面令牌和总体结果。请注意,您不需要(必须)传递第一页的pageToken。

  + ------ + ------------ + --------------- + 
|页面|页面标记|总体结果|
+ ------ + ------------ + --------------- +
| 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 |
+ ------ + ------------ + --------------- +


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:

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.

解决方案

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 |
+------+------------+---------------+

这篇关于使用pageToken时,YouTube API v3返回400错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆