FinStat PHP Client
, (*1)
API client for FinStat service., (*2)
Tech
This solution is using CURL. But if you have to use something else to make
HTTP POST, there is no problem to do that :, (*3)
<?php
require __DIR__ . '/vendor/autoload.php';
class NonCurlApiCall extends \juffalow\finstatclient\CurlApiCall {
protected function httpPost($url, $params) {
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($params)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if($result === false) {
throw \Exception('Error!');
}
return $result;
}
}
$client = new juffalow\finstatclient\Client('<your API key>', '<your private key>', null, null, new NonCurlApiCall());
Example
This is basic example how to request for company detail., (*4)
<?php
require __DIR__ . '/vendor/autoload.php';
$client = new juffalow\finstatclient\Client('<your api key>', '<your private key>');
try {
$detail = $client->getCompanyDetail('35757442');
} catch(\Exception $e) {
print_r($e);
}
You can see more in example page., (*5)