cancel($mid); // if $gid is exists. ex) $rest-cancel(null, $gid); } catch(CoolsmsException $e) { echo $e->getMessage(); // get error message echo $e->getCode(); // get 'api.coolsms.co.kr' response code }