获取当前用户的YouTube内容所有者ID [英] Obtaining the current user's YouTube content owner id

查看:292
本文介绍了获取当前用户的YouTube内容所有者ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好

我创建了一个应用,该应用从YouTube Analytics API中提取数据。我的任务是获取contentOwner货币报告,为此,我需要一个OWNER_NAME,这对我来说是个问题。我测试了具有货币报告但未将其连接到youTube CMS的YouTube帐户。

I've created an app that is pulling data from YouTube Analytics API. My task is to get contentOwner monetary reports, and for that I need an OWNER_NAME which is an issue for me. I have test YouTube account that have monetary reports on it but its not connected to a youTube CMS.


  1. 与cms.youtube.com的连接是否需要提取在YouTube分析工具上显示的contentOwner报告?

  2. 用户是否必须自己提供OWNER_NAME(或ContentOwner_ID?),或者我可以通过某种方式将其拉出?

授权会授予对yt-analytics-monetary.readonly,yt-analytics.readonly,youtubepartner和其他一些内容的访问权限。

Authorization grants access to the yt-analytics-monetary.readonly, yt-analytics.readonly, youtubepartner and few others.

推荐答案

假定您具有OAuth 2令牌,并且可以访问 https://www.googleapis.com/auth/youtubepartner 范围,则可以进行API调用到 youtubePartner.contentOwners.list(fetchMine = true)以获取与当前OAuth 2令牌关联的YouTube内容所有者的列表。 (通常只返回一个项目。)然后,您可以从 items <中每个项目的 id 属性中获取内容所有者id值。 / code>返回的列表。这是制作内容所有者YouTube Analytics API报告或使用YouTube Data API v3中的 onBehalfOfContentOwner 委派参数时可以使用的值。

Assuming you have an OAuth 2 token with access to the https://www.googleapis.com/auth/youtubepartner scope, you can make an API call to youtubePartner.contentOwners.list(fetchMine=true) to get back a list of YouTube content owners associated with the current OAuth 2 token. (There will normally only be one item returned.) You can then get the content owner id value from the id property of each item in the items list that's returned. This is the value that you can use when making content owner YouTube Analytics API reports, or using the onBehalfOfContentOwner delegation parameter in the YouTube Data API v3.

如果您无权访问 https://www.googleapis.com/auth/youtubepartner 范围,但您仍然想写要求YouTube Analytics API内容所有者报告的代码,您需要询问与您合作的内容合作伙伴,以告诉他们其内容所有者ID。

If you don't have access to the https://www.googleapis.com/auth/youtubepartner scope but you still want to write code that requests YouTube Analytics API content owner reports, you need to ask the content partner you're working with to tell you their content owner id.

我要链接到文档,但目前尚未公开公开。这是一个足够普遍的问题,我认为应该予以回答。

I'd link to the documentation, but it's currently not exposed publicly. This is a common enough question that I thought it should be answered, though.

这篇关于获取当前用户的YouTube内容所有者ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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