0% found this document useful (0 votes)
212 views

SMS Api

The document provides documentation on the SMS123 API for sending private SMS messages. It describes both the POST and GET methods that can be used to send messages. For the POST method, it lists the required parameters that must be included in the XML request, and provides an example PHP code for the request and response. For the GET method, it lists the required parameters that must be included in the URL query string. It also describes the various response parameters and possible error codes that could be returned.

Uploaded by

Aman Ullah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
212 views

SMS Api

The document provides documentation on the SMS123 API for sending private SMS messages. It describes both the POST and GET methods that can be used to send messages. For the POST method, it lists the required parameters that must be included in the XML request, and provides an example PHP code for the request and response. For the GET method, it lists the required parameters that must be included in the URL query string. It also describes the various response parameters and possible error codes that could be returned.

Uploaded by

Aman Ullah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

SMS123

API 2016

SMS123
API Documentation

1
SMS123 API 2016

POST method send private SMS

*Post URL : https://www.sms123.net/xmlgateway.php


*If you are using non-Malaysia IP, kindly contact our support for further assistance. Thank you.

<command></command> This API command "sendPrivateSMS".

<sendType></sendType> - random
(Malaysia ONLY, Recipient will receive SMS from a mobile
number.)
- shortCode
(Short Code / High Quality SMS)
- longCode
(Recipient will receive SMS from a 10-digit number.)
- longCode2
(Recipient will receive SMS from a 10-digit number.)

<email></email> Login email.

<password></password> Login password.

<recipient></recipient> Recipient mobile number.


- Use semi-colon(;) to separate each recipient.
- You can only send to a maximum of 100 recipients.
- For international SMS, kindly put the country code at the front of
each mobile number.
- e.g. (60180000000 OR 60180000000;6018000.)

<textMessage></textMessage> Message body.


- A single SMS may contain 160 characters, and 70 characters for
Unicode.
- Concatenated SMS may contain 152 characters, and 63 characters
for Unicode.
- Convert SMS content to html entities. (e.g. PHP language please
use htmlspecialchars)
- `[]~^{}|\ In our system character count as Unicode.

- For Malaysia SMS sending, RM0.00 will be included at the be-


ginning of each SMS content.
- 7 characters will be reserved from your content for "RM0.00 ".

2
SMS123 API 2016

As per SKMM guidelines, you shall include price information


at the beginning of each SMS. You shall use either "RM0.00 "
at the beginning of the SMS content. For more information,
please read our Terms & Conditions.

<validate>validate> - 1 (Validate account successful.)


- 0 (Validate account unsuccessful.)

<status></status> - 1 (API is completed successfully without any error.)


- 0 (API with error.)

<msgCode></msgCode> Error/Message code.

<msg></msg> Error/Message code explanation.

<balance></balance> Current credit balance.


(Balance do not include SMS that are processing.)

<reference></reference> You can keep this number for your reference if in the future you
have any enquiries.

Error list

Error code Error message

1204 Please enter parameter.

1301, 1302 The account is disabled.

1301, 1304 The account is suspended.

1308, 1309, Invalid email / password. Please try again.


1310

1316 Non-Malaysia IP detected. Kindly contact our support for further assistance. Thank
you.

1602 Please enter recipient(s).

1604 Please enter valid mobile number(s).

1637 You can only send to a maximum of 100 recipients.

3
SMS123 API 2016

1601 Please enter message.

1603 Cannot send more then 10 SMS. Max 10 SMS only. For 'a','b','c' character max
1520 words, for Unicode character max 630 words.

1606 Insufficient credit.

1607 You do not have enough SMS Credit for this campaign. You need an additional of
SMS Credit(s) :

1609 Private SMS has been sent.

Request and Response format

Request
<root>
<command>[COMMAND]</command>
<sendType>[SEND_TYPE]</sendType>
<email>[EMAIL]</email>
<password>[PASSWORD]</password>
<params>
<items>
<recipient>[RECIPIENT]</recipient>
<textMessage>[SMS_CONTENT]</textMessage>
</items>
</params>
</root>

Response
<root>
<validate>[ACCOUNT_VALIDATE_STATUS]</validate>
<status>[API_STATUS]</status>
<msgCode>[MESSAGE_CODE]</msgCode>
<msg>[MESSAGE]</msg>
<data/>
<balance>[CREDIT_BALANCE]</balance>
<reference>[REFERENCE]</reference>
</root>

4
SMS123 API 2016

PHP example code for request and response


Request
<?php
$URL = "https://www.sms123.net/xmlgateway.php";

$xml = "<root>";
$xml .= "<command>sendPrivateSMS</command>";
$xml .= "<sendType>longCode</sendType>";
$xml .= "<email>[email protected]</email>";
$xml .= "<password>sms123</password>";
$xml .= "<params>";
$xml .= "<items>";
$xml .= "<recipient>60180000000; 60180000000</recipient>";
$xml .= "<textMessage>";
$xml .= htmlspecialchars("welcome to my world.");
$xml .= "</textMessage>";
$xml .= "</items>";
$xml .= "</params>";
$xml .= "</root>";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));

$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Response
<root>
<validate>1</validate>
<status>1</status>
<msgCode>1609</msgCode>
<msg>Private SMS has been sent.</msg>
<data />
<balance>3434.35</balance>
<reference>12563</reference>
</root>
5
SMS123 API 2016

GET method send private SMS


*URL :
https://www.sms123.net/xmlgateway.php?command=[COMMAND]&email=[EMAIL]&password=[PAS
SWORD]&customer=[RECIPIENT]&text=[SMS_CONTENT]
*If you are using non-Malaysia IP, kindly contact our support for further assistance. Thank you.

[COMMAND] - sendRandom
(Malaysia ONLY, Recipient will receive SMS from a mobile
number.)
- sendShortCode
(Short Code / High Quality SMS)
- sendLongCode
(Recipient will receive SMS from a 10-digit number.)
- sendLongCode2
(Recipient will receive SMS from a 10-digit number.)

[EMAIL] Login email.

[PASSWORD] Login password.

[RECIPIENT] Recipient mobile number.


- Use semi-colon(;) to separate each recipient.
- You can only send to a maximum of 100 recipients.
- For international SMS, kindly put the country code at the front
of each mobile number.
- e.g. (60180000000 OR 60180000000;6018000.)

[SMS_CONTENT] Message body.


- A single SMS may contain 160 characters, and 70 characters for
Unicode.
- Concatenated SMS may contain 152 characters, and 63 charac-
ters for Unicode.
- Convert SMS content to html entities. (e.g. PHP language
please use htmlspecialchars)
- `[]~^{}|\ In our system character count as Unicode.
- For Malaysia SMS sending, RM0.00 will be included at the be-
ginning of each SMS content.
- 7 characters will be reserved from your content for "RM0.00 ".

As per SKMM guidelines, you shall include price information


at the beginning of each SMS. You shall use either "RM0.00 "

6
SMS123 API 2016

at the beginning of the SMS content. For more information,


please read our Terms & Conditions.

[STATUS] - GOOD (API is completed successfully without any error.)


- ERROR (API with error.)

[MESSAGE] Error/Message explanation.

[REFERENCE] You can keep this number for your reference if in the future you
have any enquiries.

[BALANCE] Current credit balance.


(Balance do not include SMS that are processing.)

[MESSAGE_CODE] Error/Message code.

Error list

Error code Error message

1204 Please enter parameter.

1301, 1302 The account is disabled.

1301, 1304 The account is suspended.

1308, 1309, Invalid email / password. Please try again.


1310

1316 Non-Malaysia IP detected. Kindly contact our support for further assistance. Thank
you.

1602 Please enter recipient(s).

1604 Please enter valid mobile number(s).

1637 You can only send to a maximum of 100 recipients.

1601 Please enter message.

1603 Cannot send more then 10 SMS. Max 10 SMS only. For 'a','b','c' character max
1520 words, for Unicode character max 630 words.

1606 Insufficient credit.

7
SMS123 API 2016

1607 You do not have enough SMS Credit for this campaign. You need an additional of
SMS Credit(s) :

1609 Private SMS has been sent.

Request and Response format


Request
https://www.sms123.net/xmlgateway.php?command=[COMMAND]&email=[EMAIL]&password=[PAS
SWORD]&customer=[RECIPIENT]&text=[SMS_CONTENT]

Response
[STATUS] ## [MESSAGE] ## [REFERENCE] ## [BALANCE] ## [MESSAGE_CODE]
*You can split the response by " ## ".

Example code for request and response


Request
https://www.sms123.net/xmlgateway.php?command=sendLongCode&[email protected]&pass
word=sms123&customer=60180000000&text=%20welcome%20to%20my%20world.

Response
GOOD ## Private SMS has been sent. ## 424278 ## 10000.00 ## 1609

You might also like