我正在使用YouTube Analytics API查找使用OAuth2授权的YouTube channel ,然后尝试查找该 channel 遇到的唯一观看者。这是我要发送请求的URL:
https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel==MINE&start-date=2000-06-01&end-date=2016-04-25&metrics=uniques&access_token=XXXX
在上述情况下,我使用的是
uniques
指标。但是,这是作为响应返回的内容:Array (
[error] => Array (
[errors] => Array (
[0] => Array (
[domain] =>
global [reason] =>
badRequest [message] =>
The query is not supported.
Check the documentation at
https://developers.google.com/youtube/analytics/v1/available_reports
for a list of supported queries.
)
)
[code] =>
400 [message] =>
The query is not supported. Check the documentation a
https://developers.google.com/youtube/analytics/v1/available_reports
for a list of supported queries.
)
)
这里似乎有什么问题?
最佳答案
400 response code标识错误的请求。它表明请求的格式不正确或包含无效数据。例如,如果您向错误的URL提交请求或在请求中包含不支持或不存在的参数,您将收到400响应代码。
我还发现了相同的问题here。解决他的问题的方法是,您需要指定维度以使用唯一查询。
Dimensions是用于汇总数据的通用条件,例如用户 Activity 发生的日期或用户所在的国家。
有关更多信息,请检查此page。