I want to fetch report from my default sandbox QB app. I have successfully logged in and have all data like token etc. Now how could i send GET request report using v3-php-sdk-2.1.0 mentioned in following URL?
I want to fetch report from my default sandbox QB app. How could i send GET request report using v3-php-sdk-2.1.0?
Followed this one /questions/23232279/php-sdk-v3-reporting-issues
I now trying to fetch simple account with following request header (which seems same as give here: developer(.)intuit(.)com/v2/apiexplorer?apiname=V3QBO#?id=Account under read call )
["headers_sent"]=> string(657) "GET /v3/company/1421610450/account/12 HTTP/1.1 host: sandbox-quickbooks.api.intuit.com user-agent: V3PHPSDK2.1 accept: application/json connection: close content-type: application/json Authorization: OAuth oauth_consumer_key="xxxxx",oauth_signature_method="HMAC-SHA1",oauth_nonce="xxxxx",oauth_timestamp="1440907935",oauth_version="1.0",oauth_token="a:2:{s:18:"oauth_token_secret";s:40:"xxxxx";s:11:"oauth_token";s:48:"xxxxx";}",oauth_signature="xxxxx""
And body received by oauth is
["body_recv"]=> string(675) " message=BadRequest; errorCode=003202; statusCode=400 Invalid uri 'https://oauth.intuit.net/iam/oauth_utils/v1/consumers/qyprdgehPU17WVK6BTQ54kVDfYRLFP/access_tokens/a:2:{s:18:"oauth_token_secret";s:40:"xxxxxxxxx";s:11:"oauth_token";s:48:"xxxxxxxxx";}': escaped absolute path not valid " : escaped absolute path not valid "
Here are my sdk.config (I am fetching keys and secret from my own config file thats why not set in it)
<ipp>
<security mode="OAuth">
<oauth consumerKey="" consumerToken="" accessKey="" accessToken="" />
</security>
<message>
<request serializationFormat="Xml" compressionFormat="None"/>
<response serializationFormat="Xml" compressionFormat="None"/>
</message>
<service>
https://sandbox-quickbooks.api.intuit.com/" qbo="https://sandbox-quickbooks.api.intuit.com/" ipp="https://appcenter.intuit.com/api/" />
</service>
<logger>
<requestLog enableRequestResponseLogging="true" requestResponseLoggingDirectory="/IdsLogs" />
</logger>
<!--
Available strategies are file, handler and export.
file - saves response into temporary file in system temp folder.
The file should be removed manually
handler - saves response into temporary file and provides file handler.
The file is automatically removed after script termination or when developer closes the handler
export - saves response into export folder. Additional parameter "exportDirectory" should be specified
<contentWriter strategy="export" exportDirectory="/path/to/target/folder">
For advance usage you can specify returnObject="true" to work with instance of contentWriter
-->
<contentWriter strategy="file" prefix="ipp"/>
<specialConfiguration>
<TaxService jsonOnly="true"/>
</specialConfiguration>
<minorVersion>2</minorVersion>
</ipp>
<!--Intuit Anywhere QBD-->
<!--Specify AccessToken Value for QBD-->
<add key="AccessTokenQBD" value="" />
<!--Specify accessTokenSecret Value for QBD-->
<add key="AccessTokenSecretQBD" value="" />
<!--Specify consumerKey Value for QBD-->
<add key="ConsumerKeyQBD" value="" />
<!--Specify consumerSecret Value for QBD-->
<add key="ConsumerSecretQBD" value="" />
<!--Specify realmIdIA Value for QBD-->
<add key="RealmIAQBD" value="" />
<!--Intuit Anywhere QBO-->
<!--Specify AccessToken Value for QBO-->
<add key="AccessTokenQBO" value="" />
<!--Specify accessTokenSecret Value for QBO-->
<add key="AccessTokenSecretQBO" value="" />
<!--Specify consumerKey Value for QBO-->
<add key="ConsumerKeyQBO" value="" />
<!--Specify consumerSecret Value for QBO-->
<add key="ConsumerSecretQBO" value="" />
<!--Specify realmIdIA Value for QBO-->
<add key="RealmIAQBO" value="" />
While config.php remains unchanged in v3-php-sdk-2.1.0 (NOTE i also checked it using v3-php-sdk-2.0.5 but same results)
Any help will be much appreciated. Thank you in advance.
It was because your sample oauth code was saving token by serializing accessToken
$access_token = $oauth->getAccessToken( $this->CI->config->item('OAUTH_ACCESS_URL'), '', $this->CI->input->get('oauth_verifier') ); $this->CI->session->set_userdata('token', serialize( $access_token ));
AND we need it like below to make further calls
$token = unserialize($this->CI->session->userdata('token')); $requestValidator = new OAuthRequestValidator($token["oauth_token"], $token["oauth_token_secret"],
$this->CI->config->item('OAUTH_CONSUMER_KEY'), $this->CI->config->item('OAUTH_CONSUMER_SECRET'));
This code is specific to codeigniter Library