Which email to use in Google Service Account API

北城余情 提交于 2020-01-07 09:02:22

问题


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

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

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.

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.

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 ?


回答1:


On the page you linked there is a basic setup:

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

First step is,

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

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



来源:https://stackoverflow.com/questions/34340150/which-email-to-use-in-google-service-account-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!