Is there a way to active a Google Api service in php without going through the Google API Console website?
This depends on which API you want to use. A few APIs, e.g. the Google Static Maps API do not require you to register as an application. Most APIs, especially the ones that access some user's data, however require you to setup an API project with Google's APIs Console, so Google knows that it is your application that accesses its API.
Related
can we show the google analytic Dashboard object in own website by using PHP and API or oauth?
You cant embedded the true Google analytics website in your site there would be no way to login. However you could create your own version of it.
You can use the Google Analytics API and the php client library to create your own dashboard. I have seen it done well using charts and graphs
An alternative would be the Embeded API this is javascript based though and only works with the core reporting api V3. It also does not support service accounts.
I am referring to these documents
https://developers.google.com/apps-script/api/quickstart/php
https://developers.google.com/apps-script/api/how-tos/execute
for this implementation.
These document explains examples with Auth2.0. Since I am using GCP project for this implementation, i want to use service account of my GCP project for authorization.
I have used GCP service account to use SpreadSheet Apis and its works great.
After brain storming I have finally got answer that : service accounts are not allowed to access the Execution API.
I dont want to Auth method for this implementation and service account not supported by this API.
Question: Is there any other potential way to do this.
Try running the script via an API request with the proper API Client Library. The client should be authenticated in order to perform the request successfully. The Client Libraries support several methods for making authenticated calls to the Google APIs.
Is it possible to passively access google API using google api php client library? What I want to do is connect to google API by providing necessary credentials (not using oauth).
Basically, my oauth authentication will be in googleads php lib and want to access resources using php client lib. Or is there any way to accomplish this? Thanks.
EDIT:
What I really curious about for hours is integrating those two libraries (GoogleAds PHP Api and Google API Client API). The former uses pure Oauth and the latter uses 'Google_Client' implementation in accessing Google API.
I'm developing a backoffice for a website in PHP.
In that backoffice I would like to output some google analytics info refering to that site. And only that site.
For that, I looked into the google analytics API, but I'm having some problems that I don't know if can overcome.
I don't want the API to ask for the user to login or authorization.
I want the API to access always the same account (mine) and not another google analytics account, so no authorization required.
Can that be done?
Can someone point me to a good tutorial about using the API in the context I'm looking for?
Thank You.
You can't do this with the regular API; as you mentioned, it requires the user to login. However, you can do this with the Google Analytics superProxy API.
Yes - it's possible.
You CAN connect directly to the API without it asking for authorization.
See:
Service Applications and Google Analytics API V3: Server-to-server OAuth2 authentication?
Trying to create a function that manages Google Calendar items via PHP for a Google Apps account. Cannot use web client OAuth, all authentication must be server to server.
I did the following in the Google Apps admin panel:
Enabled API access for the domain.
Created the OAuth key and secret for the domain.
Searched through many tutorials and cannot find anything related to Google Apps, and using the domain oauth key to retrieve user data. All of the examples either require a Service Account or Client OAuth (which is not an option).
Any ideas where to start?