QuickBooks Online v3 - REST API and the SDK - php

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

Related

Can you get a short-lived OAuth 2.0 access token for Firebase in PHP?

i am currently working on a Project with Firebase and i am trying to Implement the Firebase Cloud messaging service. I manage to make it work with a combination of PHP and Javascript (Javascript sends a Requiest to the server, where php makes a call to the Firebase API to send out a Notification).
The problem here is, that the code i use is for the old version, so its not using the HTTP v1.
When i looked at the docs on how to upgrade to the new version, i found out you need a short-lived OAuth 2.0 access token.
Thing is, the docs only show how you can get it via node.js, java, python, c# and go.
So my question is, is there a way to get the short-lived OAuth 2.0 access token with php or do i have to use something like node.js for it?
I'm not sure I fully understand your requirements, but if you want to send FCM notification from a PHP backend, I'd suggest checking out this (unofficial) Admin SDK for PHP (Disclaimer: I'm the creator of that library)
In its current state, you would need a Firebase Service Account (with Admin access) to be able to send notifications with it, but I'm currently working on a feature that will allow you to retrieve an OAuth access token for a given user (https://github.com/kreait/firebase-php/pull/390) in case you really need this.
I'd like to invite you to join https://discord.gg/nbgVfty (the Discord-Community around the PHP Admin SDK) to discuss your use case and process further.
Even if the SDK is not for you, looking through the code might could give you some ideas...
An alternative could be to use the Google PHP Api Client Services library, in which you can find a FirebaseCloudMessaging service.
I hope this helps!

Quickbooks Online API using PHP with Curl Oauth

The documentation for accessing the Quickbooks Online API seems to revolve around creating applications for public use. I'm only interested in developing an app to access my very own Quickbooks file. However, I'm having difficulty authenticating.
I successfully obtain all the necessary codes and can run API calls in the API playground. My preference would be not to use any libraries (including the Quickbooks PHP library as it does not support JSON).
I have spent hours searching but I do not know how to 'sign' the various secrets and codes to obtain the Oauth token needed. Does anyone have working PHP code?
I'd like to simply be able to input in the values and make the API calls via curl.
I have spent hours searching but I do not know how to 'sign' the various secrets and codes to obtain the Oauth token needed.
You sign the code using OAuth. This is a well documented authentication method, with many implementations.
Does anyone have working PHP code?
Sure:
https://github.com/consolibyte/quickbooks-php/blob/master/QuickBooks/IPP/OAuth.php#L77
https://code.google.com/p/oauth-php/
https://php.net/manual/en/book.oauth.php
https://pecl.php.net/package/oauth
https://github.com/Lusitanian/PHPoAuthLib
My preference would be not to use any libraries
OAuth is not a trivial authentication method. You should use a library to sign your requests -- it will save you a lot of time vs. implementing your own OAuth signatures.

Accessing Google App Engine's Search API from PHP

Is there anyway to do this? I've looked in the google-api-php-client library but it's not there yet. Is there any other way or am I out of luck?
The search API is only enabled for Python Java and Go, as Mario pointed out.
I would look into the modules documentation and try to separate your logic. Your search API can be the only module that isn't in PHP. There is no other solution for your problem unfortunately.
The team promised that a REST API would be made available at Google I/O 2011. I haven't been able to find any follow ups since.
https://www.youtube.com/watch?v=7B7FyU9wW8Y#t=2088
You CAN now access the Search API natively from PHP.
The library is in alpha but should make its way to release fairly soon.
It uses the Google Protocol Buffers so it's the same level of abstraction as the Python/Java/Go SDKs
https://github.com/tomwalder/php-appengine-search
Feedback appreciated!
I ran into this problem previously, so wrote a sample PHP+Python module pair to allow access to search via URL fetch to a Python module.
https://github.com/tomwalder/phpne14-text-search
I have a similar scenario as you. This might not be the best solution, but I've solved it as follows:
I've created a Python module using Google Endpoints API to expose a set of methods capable of sending and receiving JSON formatted data via HTTP GET or POST. These methods allow me create Documents and Indexes or do queries.
My PHP client, simply calls these urls and passes appropriate data.
So effectively I have a wrapper around the search API and the python stuff is hidden inside.

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.

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