Obtaining the current user's YouTube content owner id

后端 未结 1 706
野趣味
野趣味 2021-01-02 13:08

Good afternoon

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_NA

相关标签:
1条回答
  • 2021-01-02 13:49

    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.

    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.

    0 讨论(0)
提交回复
热议问题