Wednesday, 15 July 2015

Use php and simPro API to list customers -



Use php and simPro API to list customers -

i login here account: https://sandbox.simpro.co

in setup/applications created new application. access type direct access, signature method hmac-sha1

in file "application uri" points have this:

$headers = array( 'host: sandbox.simpro.co', 'authorization: oauth,oauth_version="1.0", oauth_nonce="1d0c9d11a944b2439cf867f32d59d21b", oauth_timestamp="1355952869", oauth_consumer_key="sandbox-simpro-......", oauth_signature_method="hmac-sha1access", oauth_signature="....."', 'content-type: application/json', 'accept: application/json' ); $url = 'https://sandbox.simpro.co/api/oauth/access_token.php'; $context = array( 'http' => array( 'content' => $content, 'header' => implode("\r\n", $headers) . "\r\n", 'method' => $method, 'timeout' => 10.0, 'ignore_errors'=>false ) ); $response = file_get_contents( $url, false, stream_context_create($context)); if ($response === false){ var_dump("<hr><pre>request failed", array('url'=>$url, 'method'=>$method, 'headers'=>$headers, 'content'=>$content),'</pre>'); }

nothing works. know i'm doing wrong on https://api.simpro.co/ there no php example. don't understand how set together.

how connect simpro api php?

update:

this in on script:

warning: file_get_contents(https://sandbox.simpro.co/api/oauth/access_token.php) [function.file-get-contents]: failed open stream: http request failed! http/1.0 501 not implemented in /.../index.php on line 64 string(23) " request failed" array(4) { ["url"]=> string(52) "https://sandbox.simpro.co/api/oauth/access_token.php" ["method"]=> string(4) "post" ["headers"]=> array(4) { [0]=> string(23) "host: sandbox.simpro.co" [1]=> string(318) "authorization: oauth,oauth_version="1.0", oauth_nonce="1d0c9d11a944b2439cf867f32d59d21b", oauth_timestamp="1355952869", oauth_consumer_key="sandbox-simpro-.....", oauth_signature_method="hmac-sha1access", oauth_signature="..........."" [2]=> string(30) "content-type: application/json" [3]=> string(24) "accept: application/json" } ["content"]=> string(0) "" } string(6) "

i understand don't describe in right way problem, because i'm having problem understand api. can please give me link php script part https://api.simpro.co/ used:

request token https://buildname.simpro.co/api/oauth/request_token.php

authorization https://buildname.simpro.co/oauth/authorize.php

access token https://buildname.simpro.co/api/oauth/access_token.php

i want list customers php , simpro.

might worth taking @ illustration code provide on github:

https://github.com/simpro-software/simpro-api-php

this php illustration includes basic connection simpro api using oauth , simple request of data.

please allow me know if need farther info or assistance.

php api

No comments:

Post a Comment