REST API
https://www.isms.com.my/RESTAPI.php
Parameters
Property name |
Type |
Description |
Sample |
un |
String |
Username of iSMS account. |
|
pwd |
String |
Password of iSMS account. |
|
dstno |
String |
Destination addresses must be in international format (example: 60164502380). |
60164502380 |
msg |
String |
Text of the message that will be sent. |
|
type |
Integer |
Type of SMS
1. ASCII (English, Bahasa Melayu, etc)
2. Unicode (Chinese, Japanese, etc)
|
1 |
agreedterm |
String |
Agreed iSMS Term and Condition below:
https://www.isms.com.my/user-agreement.php
API will filter your sms if you do not agreed with the agreement.
|
Yes |
sendid |
String |
Represents sender ID and it can be alphanumeric or numeric. Alphanumeric sender ID length should be between 3 and 11 characters (example: CompanyName).
|
|
Request Example
PHP
<?php
$username = 'ismsaccount';
$password = 'ismspassword';
$message = 'hello isms';
$data = array (
'sendid' => 'MOBIWEBDemo',
'recipient' => array
(
array('dstno' => '60164502380', 'msg' => $message, 'type' => '1')
),
'agreedterm' => 'YES',
'method' => 'isms_send_all_id'
);
$payload = json_encode($data);
$ch = curl_init('https://www.isms.com.my/RESTAPI.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$headers = array(
'Content-Type: application/json',
'Authorization: Basic '. base64_encode("$username:$password"),
'Content-Length: ' . strlen($payload)
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
curl_close($ch);
?>
Server Response
Return Values :- Upon message submission, iSMS's server platform will provide the user with a corresponding response value for each message.
If the SMS has been successfully sent, you'll get a response like below :-
2000 = SUCCESS:trx_id
However, if the SMS is failed, you'll get a error code and error description like below :-
-1004 = INSUFFICIENT CREDITS
Error Code |
Error Description |
Details |
2000 = SUCCESS:trx_id |
SUCCESS push SMS to telco, trx_id is unique SMS ID. |
Message Sent. |
-1000 |
UNKNOWN ERROR |
Unknown error. Please contact the administrator. |
-1001 |
AUTHENTICATION FAILED |
Your username or password are incorrect. |
-1002 |
ACCOUNT SUSPENDED / EXPIRED |
Your account has been expired or suspended.
Please contact the administrator. |
-1003 |
IP NOT ALLOWED |
Your IP is not allowed to send SMS.
Please contact the administrator. |
-1004 |
INSUFFICIENT CREDITS |
You have run out of credits.
Please reload your credits. |
-1005 |
INVALID SMS TYPE |
Your SMS type is not supported. |
-1006 |
INVALID BODY LENGTH (1-700) |
Your SMS body has exceed the length.
Max limit = 700 |
-1007 |
INVALID HEX BODY |
Your Hex body format is wrong. |
-1008 |
MISSING PARAMETER |
One or more required parameters are missing. |
-1009 |
INVALID DESTINATION NUMBER |
Invalid number |
-1012 |
INVALID MESSAGE TYPE |
Message contain unicode and please use type=2 for Unicode |
-1013 |
INVALID TERM AND AGREEMENT |
Please add agreedterm=YES in your API |
Download Sample PHP File