在Google服务帐户API中使用哪个电子邮件 [英] Which email to use in Google Service Account API

查看:164
本文介绍了在Google服务帐户API中使用哪个电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遵循此Google教程: https://developers .google.com/analytics/devguides/reporting/core/v3/quickstart/service-php

Following this Google Tutorial : https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-php

并使用此PHP库: https://github.com/wanze/Google-Analytics-API-PHP

And using this PHP library : https://github.com/wanze/Google-Analytics-API-PHP

我有一个小问题.我只是找不到本教程中所述的电子邮件.我认为API接口已更改,并且该教程较旧.

I have a little problem. I just don't find the email to use as described in the tutorial. I think the API interface has changed, and the tutorial is old.

我已经创建了我的项目,激活了Analytics API,并创建了一个服务帐户".它会生成一封电子邮件,但不会采用projectId-uniqueId@developer.gserviceaccount.com格式.

I have created my project, activate Analytics API, and create a "Service account". It generates an email, but not in projectId-uniqueId@developer.gserviceaccount.com format.

我尝试使用创建的新电子邮件(例如name@name-1162.iam.gserviceaccount.com),但遇到此错误:

I tried with the new email created (like name@name-1162.iam.gserviceaccount.com) but I catch this error :

invalid_grant

有什么变化吗?我做错了什么?

Is something changed ? What I am doing wrong ?

推荐答案

在链接的页面上有一个基本设置:

On the page you linked there is a basic setup:

https://github.com/wanze/Google-Analytics-API-PHP

第一步是

在Google API控制台中创建一个项目: https://code.google.com/apis/console/

Create a Project in the Google APIs Console: https://code.google.com/apis/console/

这与您的其他指南完全不同. 最好遵循github页面上的内容.

And that differs completely from the other guide you have. At best follow what it says on the github page.

这篇关于在Google服务帐户API中使用哪个电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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