PHP Classes

Retrieve AccessTokenSecret from Intuit

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  Learn with a PHP OAut...  >  All threads  >  Retrieve AccessTokenSecret from Intuit  >  (Un) Subscribe thread alerts  
Subject:Retrieve AccessTokenSecret from Intuit
Summary:Not returning AccesTokenSecret or RealmID
Messages:6
Author:Murray Russell
Date:2017-02-17 15:07:25
 

  1. Retrieve AccessTokenSecret from Intuit   Reply   Report abuse  
Picture of Murray Russell Murray Russell - 2017-02-17 15:07:25
Using the consumer key in client_id and Consumer Secret in client_secret within this class I am successfully connected to Intuit (Quickbooks) and get the following response:-

stdClass Object
(
[User] => stdClass Object
(
[Role] =>
[IntuitRoles] =>
[Id] => 72706420.bi3b
[FirstName] => Murray
[LastName] => Russell
[UserName] =>
[EmailAddress] => <my email>
[ScreenName] => <my email>
[IsVerified] => 1
[LastAccess] =>
)

[ErrorMessage] =>
[ErrorCode] => 0
[ServerTime] => /Date(1487343637799)/
)

Is the returned [Id} the RealmID?
Is there a way to get the Access Token Secret returned as well so it can be included in the PHP SKD from Intuit to start retrieving or sending data between my system and Quickbooks?

Many thanks for any assistance.

  2. Re: Retrieve AccessTokenSecret from Intuit   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2017-02-17 19:51:40 - In reply to message 1 from Murray Russell
I don't know about the ReamlID. You need to check the API documentation on their site.

As for the access token it is in the access_token variable.

But if you are using this class, why do you need to use Intuit SDK?

  3. Re: Retrieve AccessTokenSecret from Intuit   Reply   Report abuse  
Picture of Murray Russell Murray Russell - 2017-02-18 07:44:21 - In reply to message 2 from Manuel Lemos
Thank you for the prompt reply. I would rather use your class than the Intuit API, however have not been able to figure out how to send a "select * from Customers" etc. to Quickbooks once I have established the connection using your class. If you have one, please send me an example of the code to use to request/send data from/to Quickbooks Online once the connection has been established.

The code provided by Intuit requires the RealmID and AccessTokenSecret which are apparently returned once connection has been established and then get used when implementing queries.

  4. Re: Retrieve AccessTokenSecret from Intuit   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2017-02-18 21:50:20 - In reply to message 3 from Murray Russell
I guess it is possible to make the calls you want without using Intuit SDK because it is all HTTP requests that the OAuth class can do. You need to check the API documentation.

Anyway, the access token secret is in the access_token_secret variable of the OAuth class.

The RealmID for your company is found here.

community.intuit.com/questions/1021 ...

  5. Re: Retrieve AccessTokenSecret from Intuit   Reply   Report abuse  
Picture of Murray Russell Murray Russell - 2017-02-19 15:26:11 - In reply to message 4 from Manuel Lemos
Please forgive my ignorance. Your class makes the connection wtih Intuit QyickBooks and I can now see the access_token_secret. The QuickBooks API states to collect all customer data it requires:-

GET https://quicbooks.api.intuit.com/v3/company/123145744995499/query?query=select * from Customer

The 123145744995499 is the RealmID

I get the impression I should be passing this in some form from the callAPI method of your OAuth class and if that is correct, am having a problem with structuring the parameters.

$selectstmt = 'select * from Customer';
$url = 'https://quicbooks.api.intuit.com/v3/company/123145744995499/query?query='.$selectstmt;
$method = 'GET';
$parameters = '';
$options = '';
$response = '';

$client->callAPI($url, $method, $parameters, $options, &$response);

Can you advise how their requirement should be formatted in your OAuth callAPI method please.

  6. Re: Retrieve AccessTokenSecret from Intuit   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2017-02-20 00:36:12 - In reply to message 5 from Murray Russell
You need to use PHP URLEncode function to encode the query parameter. All the rest seems fine.

developer.intuit.com/docs/0100_quic ...