我正在运行一个服务,人们可以使用oauth 2.0连接他们的Google账户,并且通过YouTube权限我可以管理他们的频道/访问他们的YouTube频道ID。
然而,我的问题是是否能够反向操作。也就是说,如何从给定的YouTube频道ID确定Google账户所有者?
然而,我的问题是是否能够反向操作。也就是说,如何从给定的YouTube频道ID确定Google账户所有者?
contentDetails.googlePlusUserId
不再作为contentDetails部分的一部分存在,因此已从https://developers.google.com/youtube/v3/docs/channels#properties中删除。根据他们变更日志中的摘录:
2016年6月13日
此更新包含以下更改:
- 已弃用
channel
资源的contentDetails.googlePlusUserId
属性。以前,仅当频道与Google+配置文件相关联时,该属性才存在。随着弃用,该属性将不再包含在任何channel
资源中。- 已弃用
comment
资源的snippet.authorGoogleplusProfileUrl
属性。以前,仅当频道与Google+配置文件相关联时,该属性才存在。随着弃用,该属性将不再包含在任何comment
资源中。由于这两个属性都将在弃用后不返回,因此已从相应的资源文档中删除了这两个属性。
:
https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id={CHANNEL_ID}&key={YOUR_API_KEY}
{
"kind": "youtube#channelListResponse",
"etag": "fooHash",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [{
"kind": "youtube#channel",
"etag": "fooHash",
"id": "fooHash",
"contentDetails": {
"relatedPlaylists": {
"likes": "fooHash",
"favorites": "fooHash",
"uploads": "fooHash"
},
}
"googlePlusUserId": "{ID}"
}]
}