我正在使用 YouTube 直播 API 服务,如下所述,
https://developers.google.com/youtube/v3/live/registering_an_application#create_project
我希望您使用 API key ,而不是 OAuth 2.0 进行通信。但是当我请求时
https://www.googleapis.com/youtube/v3/liveBroadcasts?part=id&broadcastStatus=all&key=[My_App_Key]
我总是以
结束{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
知道为什么我被迫使用 OAuth 并且无法使用 API key 进行操作吗?
最佳答案
LiveBroadcasts: list在顶部声明
Authorization
This request requires authorization with at least one of the following scopes (read more about authentication and authorization).
您不能通过此方法使用公共(public) API key ,您必须使用 oauth2 进行身份验证。
关于authentication - YouTube 直播 API 请求与 Api key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32182825/