YouTube 分析 API [英] YouTube Analytics API

查看:57
本文介绍了YouTube 分析 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Google apis 的新手,想开始使用 YouTube 分析 API 来生成报告.我在 Google 开发人员控制台中创建了项目.当我点击凭据时,有两个选项 - OAuth 和公共 API 访问.我是无法理解我应该采用哪种方式进行 OAuth 或公共 API 访问.对于 OAuth,在创建新客户端 ID 时有三个选项 - Web 应用程序、服务帐户和已安装的应用程序,所以这里也是推荐的方式?请帮助我理解这一点东西.

I am newbie for Google apis and wanted to start on working YouTube Analytics API to generate reports.I have created project in side Google developer console.When I click on credentials there are two options - OAuth and Public API access .I am not able to understand with which way I should go OAuth or Public API access .For OAuth while creating new client id there are three options - Web application,Service Account and Installed application so here also which is recommended way ?Please help me to understand this things.

注意:我们的要求是使用 YouTube Analytics API 为我们客户频道上上传的视频生成报告.

Note : Our requirement is to use YouTube Analytics API to generate reports for uploaded videos on our clients channel.

推荐答案

当涉及到私人用户数据时,OAuth 2.0 是 Analytics API 的推荐授权方法.如果您正在收集和存储要在您端使用的数据,您很可能希望采用服务器端应用程序方法.

When it comes to private user data, OAuth 2.0 is the recommended authorization method for the Analytics API. If you're collecting and storing data to be used on your end, you most likely want to go with the server-side application approach.

来自文档:

  • 服务器端流程支持可以安全存储持久信息的网络应用程序.
  • 客户端流程支持在浏览器中运行的 JavaScript 应用程序.
  • 安装的应用流程支持安装在手机或计算机等设备上的应用.
  • The server-side flow supports web applications that can securely store persistent information.
  • The client-side flow supports JavaScript applications running in a browser.
  • The installed application flow supports applications installed on a device, such as a phone or computer.

来自关于服务帐户选项的文档:

From the documentation on the service account option:

服务帐户流支持不访问用户信息的服务器到服务器交互.但是,YouTube 分析 API 不支持此流程.由于无法将服务帐户关联到 YouTube 帐户,因此尝试使用此流程授权请求将产生错误.

The service account flow supports server-to-server interactions that do not access user information. However, the YouTube Analytics API does not support this flow. Since there is no way to link a Service Account to a YouTube account, attempts to authorize requests with this flow will generate an error.

有很多关于所有这些选项的文档提供给您,我建议您通读全文以确保您牢牢掌握这些概念.点击此处了解 OAuth 2.0 和 YouTube 分析 API

There's a lot of documentation on all of these options provided to you, I'd recommend reading through it in its entirety to make sure you have a firm grasp on the concepts. Click here to read about OAuth 2.0 with the YouTube Analytics API

干杯!

完全清楚,如果您通过后端应用程序收集数据,请使用服务帐户"选项来生成 OAuth 客户端 ID.但是,如果您通过 Web/已安装的应用程序与 API 报告进行交互,则应选择Web/已安装的应用程序".我希望这对您有所帮助且清楚.

Just to be completely clear, if you're collecting data through a backend application, use the "Service Account" option for generating OAuth Client IDs. If, however, you're having a interact with the API reports through a web/installed application, you would select "Web/Installed Application". I hope this was helpful and clear.

这篇关于YouTube 分析 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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