mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-15 17:29:55 +09:00
29 lines
707 B
PHP
29 lines
707 B
PHP
<?php
|
|
/**
|
|
* #example_balance
|
|
*
|
|
* This sample code demonstrate how to check cash & point balance through CoolSMS Rest API PHP
|
|
* for more info, visit
|
|
* www.coolsms.co.kr
|
|
*/
|
|
|
|
use Nurigo\Api\Message;
|
|
use Nurigo\Exceptions\CoolsmsException;
|
|
|
|
require_once __DIR__ . "/../../bootstrap.php";
|
|
|
|
|
|
// api_key and api_secret can be obtained from www.coolsms.co.kr/credentials
|
|
$api_key = '#ENTER_YOUR_OWN#';
|
|
$api_secret = '#ENTER_YOUR_OWN#';
|
|
|
|
try {
|
|
// initiate rest api sdk object
|
|
$rest = new Message($api_key, $api_secret);
|
|
|
|
$result = $rest->getBalance();
|
|
print_r($result);
|
|
} catch (CoolsmsException $e) {
|
|
echo $e->getMessage(); // get error message
|
|
echo $e->getCode(); // get error code
|
|
}
|