Youtube Analytics API Issue? - php

When reading through the Youtube API, i noticed that the base url for requestions was using version 3 https://www.googleapis.com/youtube/analytics/v3/,
However, when i was using the youtube ANalytics API PHP class, the URL being requested was version 1. https://www.googleapis.com/youtube/analytics/v1/ is this an issue, or is the PHP library just out of date? I really do not want to have to make another one class (reinvent the wheel), but i am skeptical about using outdated code. Thanks.

This is not a problem, the current version for the Analytics API is v1, as you can see in the API explorer.

Related

QuickBooks Online v3 - REST API and the SDK

I'm having a bit of trouble figuring out how to properly proceed making calls using the Intuit QuickBooks Online API v3. I've looked at the API Explorer, and from my understanding, I can send and receive JSON.
They also provide information about the base URL, the entity, etc: https://developer.intuit.com/docs/api/accounting/Customer
So I'm wondering, am I supposed to be using the QuickBooks SDK that they mention to download? https://developer.intuit.com/docs/0100_accounting
Or would I be able to utilize their API using something like cURL? I don't want to reinvent the wheel of course, but with all the information they provide and no reference to the SDK itself, that's where I started to get a little confused. They basically tell you how to make the calls, but don't reference the SDK in those documents.
Just to provide some extra information, I'm using PHP 5.5 and Laravel.
So I'm wondering, am I supposed to be using the QuickBooks SDK that they mention to download?
If you want to, sure.
Or would I be able to utilize their API using something like cURL?
Again, if you want to, sure. Just be aware that if you use cURL, you'll have to do some OAuth signing of your requests (see the OAuth spec) or find an OAuth lib too.
Here's another open-source alternative if you need something with more examples (disclaimer: I'm the author):
https://github.com/consolibyte/quickbooks-php
Examples:
https://github.com/consolibyte/quickbooks-php/tree/master/docs/partner_platform/example_app_ipp_v3

Youtube Analytics PHP cron

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.

Why the Facebook PHP SDK is out of date? What is the alternative?

I'm so frustrated right now. I spent so much time trying to debug my application to find out that the official PHP SDK from Facebook is out of date and doesn't look like it's maintained anymore: https://github.com/facebook/facebook-php-sdk
After lodging a bug to Facebook because of an error returned by the API, one of the employee at Facebook respond the following:
THe old REST API does not support use of Page Access Tokens, you need to use the Graph API for such API calls - if you're using an SDK, please ensure it's routing your FQL queries to https://graph.facebook.com/fql?q=X and not https://api.facebook.com/method/fql.query
However in the PHP SDK that Facebook provide it's using the following request:
URL: https://api-read.facebook.com/restserver.php
GET: method=fql.query&return_ssl_resources=1&query=SELECT+comment_info.comment_count%2C+created_time%2C+like_info.like_count%2C+permalink%2C+post_id%2C%0A+share_info.share_count%2C+type%2C+attachment.media%0A+FROM+stream%0A+WHERE+actor_id%3Dxxxxxx%0A+AND+source_id%3Dxxxxxx%0A+ORDER+BY+created_time+DESC%0A+LIMIT+100&callback=&api_key=xxxxxxxxx&format=json-strings&access_token=xxxxx
Anyone bumped into this issue? What SDK are you using instead?
The PHP SDK on Github is still maintained and the official source (see https://developers.facebook.com/docs/reference/php/)
Still, old API (like the REST api) are still supported for backward compatibility concerns. But for new stuff, you need to use the Graph API. If you read the documentation, it is very clear that the Graph API is the way to go (there's no mentions of REST api in the documentation). https://developers.facebook.com/docs/reference/php/facebook-api/
So, I think the issue here is you started of reading some old blog posts without reading the official APIs docs. Honestly, around Facebook stuff, only believe what you can find in the official documentation and on StackOverflow with a good vote rating. Too many bad developers have been trying to bring SEO to their websites writing shitty article on developing Facebook apps.

Google Doc and DropBox PHP api's

I want to add a list of all files from my google docs and from dropbox on my website(not a google site). The code of my website is mostly in PHP. I am unable to find a PHP guide for Google Docs list API and dropbox API. Any help is appreciated thanks in advance.
Here's Google APIs Client Library for PHP. Link
You probably need to check this as well: Google Drive SDK
There's a tab for PHP example
3rd Party Dropbox PHP SDK and the Docs for the API generally. You will specifically want to look into the /metadata and /files (GET) calls

facebook api confusion

I am coming back to facebook app development after a long time. And I am confused :)
Am I required to use the Graph API or can I still use the REST Api?
Because I am unable to make calls with the old REST api methods.
I am using PHP. Do I need to use the (now) official SDK?
thanks a lot in advance.
You can still use the REST API, but they recommend developers to use the new Graph API. I'd be surprised if Facebook doesn't start phasing out the old API soon, and ultimately deprecate it altogether.
You can make API calls to the old REST API with Facebook's new PHP SDK as well, and unlike the old library it doesn't suck.

Categories