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.
Related
We have been developing a multi platform project which will eventually have an Android app, an iOS app and a web application. We are impressed with the features offered by Google Firebase therefore trying to leverage the opportunities.
Since our product is a multitenant software-as-a-service application we have custom authentication requirements. Therefore we followed the custom authentication implementation path of Firebase and it is functional now.
Our mobile clients send login requests to our API server,
Our API server issues customTokens and reponds them back to the clients,
Clients call signInWithCustomToken(customToken) method to sign in to Firebase.
So far so good.
What the issue is, our backend is in PHP and Firebase doesn't have an official Admin SDK for PHP. Yes, there is a package called kreait/firebase-php on Composer however it is far away from covering all of the Auth Admin SDK features. For example, there is a documented disable-user feature which is available on Firebase Admin SDK, however that operation is not implemented on the kreait/firebase-php package.
On the other hand Firebase has a Auth Rest API which just works with the API KEY. However, (I suppose ) it is designed to work on the client side therefore it just has operations for the authenticated user.
Our API server is already hosted on Google Compute Cloud and has the maximum set of access permissions on the Google Cloud services.
We have the Firebase service account file to work with the Firebase Auth services.
What we need is to consume all available Firebase Admin SDK features (possibly via Rest). For example, we would like to call revokeRefreshToken(uid) when a user changes his/her password on one of his/her devices.
Since at this specific issue there isn't any documentation, what would you advise us to do?
Update (25 January 2018)
The above mentioned missing endpoints on the Firebase unofficial PHP Admin SDK are now implemented by the maintainer after a productive discussion on a Github issue. However, I would like keep this question open since the nature of the question is asking for ideas for further collaboration and discussion.
Maintainer of said unofficial PHP SDK here :). You already have updated your original post to include that the SDK now supports the features that were missing.
I am posting this as a dedicated answer to be visible to people arriving here and searching for answers as well.
Although the Admin SDK for PHP is still not feature complete, we are getting there. I added feature matrix to the README of the Github project so that you can quickly see what is available and what isn't.
Going forward, I will implement new features by either implementing things similarly to the official Admin SDKs (especially https://github.com/firebase/firebase-admin-node) and by using the existing libraries provided by the Google Cloud Platform Library.
At some point in the future, Google will certainly provide all the necessary building blocks to use Firebase efficiently with PHP, but until then, I am happy about every happy PHP developer using my library :).
FYI: I just released a new version (4.1.0) which includes support for Firebase Cloud Storage and did in fact use the google/cloud-storage for that.
I think you can use the Identity Toolkit libraries provided by Google. Here's the one for PHP: https://github.com/google/identity-toolkit-php-client
I want to access monthly installs reports from Google Play Store in PHP.
I have not find any Google Play Store API for same.
Can any one help me on this ?
Thanks a lot in advance.
It is possible in two ways
Download reports using a gsutil (command line tool)
Download reports using a client library & service account
refer this link for more information
I am implemented In App Billing for android.I wanted to implement subscription validity checking through my backend server. As Google Play Documentation, for making call for Google Play API,need authentication using oauth 2.0.
I followed instructions for registering project and creating credentials. But from there I have no idea how to use those credentials, I tried authentication via CURL request, but it asking permission as shown in follwing image
This permissions works fine I can exchange code and get access token, but all this done by manually, how should I implement this on backend.
I even try to use google api php library provided by Google, but It adds confusion. Also they didn't provide any example, how to use library.
Can anybody elaborate how exactly use library or pure php?
Thanks in advance.
To perform LVL and/or IAB validation on a server, do not access Google servers directly from the server. Even if all information were available, you would face integrity problems, because your app and your server will see different information due to synchronization latencies.
Instead, use your app as a proxy and validate the Google Play information on your server as described here.
I'm very new to web development. I have searched for login with Google plus and found several good tutorials. But they seems to be very old (most of them from 2011). Why?
I tried below code chunks.
<script type="text/javascript" language="javascript">
$("#packagesGrid").load('https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=ya29.ahes6zt9yv2qaeej5ycn21fn9maokp15scwqkcal3guqxxez7odtjg&token_type=bearer&expires_in=3600');
</script>
I just manually copy pasted the token to the url on the jQuery load function. But nothing is filled to the page.
Google APIs use the OAuth 2.0 protocol for authentication and authorization. Google supports several OAuth 2.0 flows that cover common web server, JavaScript, device, installed application, and server to server scenarios. The Previous Versions of OAuth has been deprecated by Google.
Here is how it works : https://developers.google.com/accounts/docs/OAuth2
To Get Started with Coding,
https://code.google.com/p/google-plus-php-starter/
Just download the project and Follow the steps mentioned.
I have tried this recently and it's working 100% fine.
I'm in a Google presentation at the moment and apparently they have just launched Google+ sign-in, which allows you to do stuff like this much more elegantly.
I don't know any more about it than that, really, but it certainly seems worth a look.
I would suggest making use of the following tutorial Login with Google Account OAuth. It explains calling the correct methods and saves the user data to your database. Plus it was published today.
For this you have to use google client Api library for php
and after that, you need to generate some key (like client id, client secret key, simple API key for Google)
then you have to use these API and use the keys generated. You can find the complete procedure and documents at there corresponding websites...
If you neeed the working tutorial.
I want to develop a bot which will update the status of a facebook account using php.
Please guide me on this
#Porkchop is correct, you will probably need the Facebook Connect API. To update a users status on Facebook, you should look at the Status.set API call.
For coding a googletalk bot in php there are some articles that should get you started:
Twitter PHP Jabber Bot Tutorial
Jabber Simple - A PHP library
But also consider using IMified, which does a lot of the work of creating and running chat bots for you.
If all you are interested in is a simple way to update your Facebook status from you Google Talk status, you probably don't need to go to all that work - just install the 'Google Talk Status Synchronizer' facebook application.
You could hire somebody to do it for cheap by outsourcing it, i mean thats what i do when i dont know code.
Since you are coding in PHP, I recommend using Jaxl (Jabber XMPP Library).
It supports bot authentication using X-FACEBOOK-PLATFORM and updating facebook status should be a one line task using the library. http://github.com/abhinavsingh/JAXL