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 ?
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.
Related
After hours of work I am stuck with using google calendar php api, I need the basic functionality, reading and adding events (updating and removing later), any advice? I need the solution that works with the recent version of the api and is relatively simple.
Everything you need is well documented on Google Developers website. You will need composer to be running in your project and a Google Account.
On Google Developers page listed above, click Enable the Google Calendar API, select existing project or create a new one and click next. You will get your Client ID and unique Client Secret. You can manage this credentials in API Dashboard. Download these credentials.json and put them in your workdir.
Then you can setup composer for Google Client Library
composer require google/apiclient:^2.0
Now you can set up the sample. Create a file named quickstart.php and put there this code. You can run the sample using php quickstart.php.
Would you like to share your code with us, so we will be able to support you with more relevant answers?
I am trying to run a sample PHP web application integrated with Google Wallet. Similar to this: http://iap-php.appspot.com.
I have been following the documentation provided in https://developers.google.com/wallet/objects/quickstart-php#register. I created a project. And I couldn't get Wallet Object API in the list.
And I am stuck here:
And on clicking "sign up for Wallet Objects API access", I have filled the form and got a mail from Google that:
We are reviewing your information and will update you via email on your eligibility and next steps soon.
And I am unable to continue further.
Basically I wanted to run this integration with PHP on my localhost for testing purpose. How do I setup wallet objects? What docs I have to read? From where do I have to start?
I saw a post two days ago :
google api calendar php
And it looks like the code I need. I am only an amateur php programmer. I had been using Zend Framework to connect my website to a Google calendar to make changes on the calendar from my site,but now deprecated as it used V2 of Google API.
So now I am trying to use the PHP client library and have gone to the Google Developer console and created what I think is an 'App' (service account) to use the php client library. In the code in the above post there is a line:
$client->setApplicationName("My app");
I am not sure what that refers to? I have a 'project name' when creating it in the console but I am really not sure if this is the 'App name'. Or worse maybe i am not creating an app at all and have made a mistake. I have all the other parameters like client ID, key file and service account.
P.S. I saw one post where you had to add client ID to the ../src/Google/config.php file - is that needed as well?
thx
I found all the advice on setting up a service account and also the code for adding an event at daimto.com
App name can just be the project name form your Google console too BTW.
I want to start developing a tool that runs daily via cron for getting daily analytical data from one channel, or video, etc.. through the "Youtube Analytics API". And not what is the best way to approach it.
I have read the documentation of Google and and I have several questions:
I created the project in the console (https://code.google.com/apis/console/) but I doubt what kind of application I have to choose when I create a Client ID (Web Application, Service Account or Installed aplplication).
What PHP library use?
It's a very new API and not much information.
In the Google GData site there is a warning about that "Most newer Google APIs Google Data APIs are not Google Data APIs." and in the google-api-php-client, no examples of this API.
What is the best method for authentication in a cron?
As you can see I am very confuse, can someone help me, please?
Thank you.
1) It will be an installed application unless you will run it in a web server.
2) Use the official library, add the ytanalytics php library. Samples: https://github.com/youtube/yt-samples-php
3) You can do so by getting a refresh token from OAuth2 Playground and setting it in your youtube object.
Here it explains a little more.
And a step by step video.
I want to authenticate a user using Google account. I had developed oauth using some libraries.
But it is giving me a message like some website is asking permission to access google docs/calendar/etc.,.
When we are logging into stackoverflow.com it is asking stackoverflow.com is accessing you#gmail.com. How can i get a permission for email address.
Update: I developed oauth using Zend PHP library.
And see the screenshots
stackexchange.com
My application screenshot
Thank You
At the moment, I'm working on example ZF 1.11 application that uses OpenID and openid-selector. The ZF application, called zfopenid, can be downloaded from here (it contains full ZF library and it should work out of the box):
Authentication with google, yahoo works (at least for me) at this stage. To make it work I needed to make some changes in Zend_OpenId_Consumer described at http://framework.zend.com/issues/browse/ZF-6905 + some additional changes. Also I incorporated My_OpenId_Extension_AttributeExchange (i.e. AttributeExchange implementation by Chris Bisnett) to fetch email from google, yahoo (at the moment it is not displayed, but it should be in $_GET variable returned from google, yahoo, aol or myopenid to user/login).
So, if you or anyone would like to test it, I would be grateful as I'm planning to eventually write a blog post about this. Any feedback would be very helpful at this stage. Specifically, whether it really works, or it just works for me (I'm running it on localhost using XAMPP for Linux 1.7.3a and Linux Mint 10).
I did some experiment with ZF to create OPEN ID login form , but i case of google , i was able to sign in but i wasn't able to ask google for the user info
because google is implementing openid extension called AX as i remember , while ZF implement only SREG , you can find it in library/Zend/OpenId/Extension
here is my demo example http://zc.dagho.com/index/login , its working very nice with google and others but it can't ask for users info
and you can take alook to : How to get OpenID user Profile info?
Google implements AX as well as Yahoo
(you have to request permission from
yahoo). Unfortunately Zend Framework
OpenID only supports SREG at the time
of this writing but I've written an
extension for AX support here as well
ak33m.com/?p=71 – Akeem Oct 29 '09 at
2:27
http://framework.zend.com/issues/browse/ZF-6905
update : this might be good , i didn't test it :
http://framework.zend.com/issues/browse/ZF-7328
I believe Stackoverflow uses the http://www.dotnetopenauth.net/ library.
https://meta.stackexchange.com/questions/56109/stack-overflow-and-dotnetopenauth
you can authenticate users using google open id as in stackoverflow login.