我正在尝试使用YouTube的v3 API创建广播。我的请求看起来像这样:
curl -H "Authorization: Bearer ******************" -H "Content-type: application/json" -d " {"snippet":{"title":"Hello", "scheduledStartTime":"2014-01-30T00:00:00.000Z", "scheduledEndTime":"2014-01-31T00:00:00.000Z"},"status":{"privacyStatus":"public"}}" https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet,status
但是我从google得到的回复是:
{
"error": {
"errors": [
{
"domain": "youtube.liveBroadcast",
"reason": "liveBroadcastForbidden",
"message": "Request is not authorized"
}
],
"code": 403,
"message": "Request is not authorized"
}
}
我可以确认我传递的访问令牌是正确的。我做错了什么吗?
直播API目前仅对合作伙伴可用。稍后会有更广泛的应用。如果您已经获得了授予的访问权限,您应该从API控制台启用YouTube API。