Hiworks Oauth v2 PHP 연동 모듈
composer require cobiyu/hiworks-oauth-sdk
Note: Note: This version of this SDK for PHP requires PHP 5.6 or greater.
Doc Link: https://documenter.getpostman.com/view/6863253/S1TVWcri?version=latest#intro
$client = new \Hiworks\Hiworks($app_client_id,$app_password);
$client = new \Hiworks\Hiworks($app_client_id,$app_password);
// getAccessToken return Hiworks\Auth\AccessToken instance.
// $auth_code is received parameter(name:auth_code) in your app's callback.
$access_token = $client->getAccessToken->getAccessToken($auth_code);
echo $access_token->getAccessToken(); // print access_toekn (example. fh283nfdsialvcxzvclxzvcxz)
// $path and $access token must be string.
// api result is object.
$get_response = $client->get($path, $access_token)
$post_response = $client->post($path, $access_token)
$put_response = $client->put($path, $access_token)
$delete_response = $client->delete($path, $access_token)
Hiworks\Exceptions\HiworksSDKException : package의 최상위 Exception
자세한 exception 내용이 필요하다면 , Hiworks\Exceptions 참조
catch(HiworksSDKException $e)
{
/// some logic
}