# Introduction

The API we provide programmatic access to Online Live Support features and data. In designing the API, our goal was to make it simple, intuitive, and predictable. The standards used in this API are widely accepted

![](https://www.sms123.net/images/point.png)We use POST HTTP request instead of GET is because it has no restrictions on data length. Thus, the output can contain long sentences that returned by the API.

![](https://www.sms123.net/images/point.png)POST supports binary data type as well. Hence the possibilities of user uploading images to change their logo.

![](https://www.sms123.net/images/point.png)For security concern, POST is a little safer because the parameters are not stored in browser history and web server logs unlike GET.

![](https://www.sms123.net/images/point.png)By using POST, the URL will remain clean because the data will not be displayed in URL.


# GET method send SMS

```
https://app-sms.online-live-support.com/api/send.php?apiKey=[APIKEY]&recipients=[RECIPIENTS]&messageContent=[MESSAGE]&referenceID=[CUSTOMREFERENCEID]
```

| \[APIKEY]            | API Key. (Find your API key at <https://app-sms.online-live-support.com/dashboard.php> My Account > Settings)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \[RECIPIENTS]        | <p>Recipient mobile number.<br>- Mobile number with country code.<br>- Once recipient one request.<br>- One recipient one request.<br>- You can use semi-colon(;) to separate each recipient without space when sending multiple recipients.</p>                                                                                                                                                                                                                                                                                                                                                         |
| \[MESSAGE]           | <p>Message body.<br>- A single SMS may contain 160 characters, or 70 characters for Unicode.<br>- Concatenated SMS may contains 152 characters, or 63 characters for Unicode.<br>- All Malaysia mobile number will be minus 7 characters “RM0.00” at the beginning of each SMS content.<br>- Maximum of 10 concatenated SMS.<br><br><strong>As per SKMM guidelines, you shall include price information at the beginning of each SMS. You shall use either “Free msg/RM0.00/Msj ini percuma” at the beginning of the SMS content. For more information, please read our Terms & Conditions.</strong></p> |
| \[CUSTOMREFERENCEID] | An unique reference id from your system to avoid duplicate request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| \[STATUS]            | Show the status for send SMS (**ok** / **error**)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| \[MSGCODE]           | Show code to represent particular status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| \[REFERENCEID]       | Your reference for any future enquiries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| \[BALANCE]           | Your account current balance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| \[DATA]              | Each recipient sending reference ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

## Request and Response format

**Encourage to use URL encode on the request link / url to converts reserved, unsafe, and non-ASCII characters in URLs to a format that is universally accepted and understood by all web browsers and servers. Paste it here and encode link**

**Please refer to here to know more about url encoding characters reference**

**Request**

<https://app-sms.online-live-support.com/api/send.php?apiKey=\\[APIKEY]\\&recipients=\\[RECIPIENT]\\&messageContent=\\[MESSAGE]\\&referenceID=\\[CUSTOMREFERENCEID>]

**Encoded Request**

https%3A%2F%2Fapp-sms.online-live-support.com%2Fapi%2Fsend.php%3FapiKey%3D %5BAPIKEY%5D%26recipients%3D%5BRECIPIENT%5D%26messageContent%3D %5BMESSAGE%5D%26referenceID%3D%5BCUSTOMREFERENCEID%5D

**Response**

{"status":"\[STATUS]","msgCode":"\[MSGCODE]","statusMsg":"\[ STATUSMSG]","referenceID":"\[ REFERENCEID]"," balance":"\[ BALANCE]", "data": "\[DATA]" }\
\
&#x20;\*Response array encoded with **JSON**\
\ <br>

## Example code for request and response

**Request**

* **Single recipient**\
  &#x20;<https://app-sms.online-live-support.com/api/send.php?apiKey=22f277843206d477d3cd4ae1c9220bc3\\&messageContent=Testing%123\\&recipients=> 6010xxxxxxx\&referenceID=ba63ht12opab6
* **Multiple recipients**\
  &#x20;<https://app-sms.online-live-support.com/api/send.php?apiKey=22f277843206d477d3cd4ae1c9220bc3\\&messageContent=Testing%123\\&recipients=> 6010xxxxxxx;6012xxxxxxx\&referenceID=iyr340hbc6ja0b

**Encoded Request**

* **Single recipient**\
  &#x20;https%3A%2F%2Fapp-sms.online-live-support.com%2Fapi%2Fsend.php%3F apiKey%3D22f277843206d477d3cd4ae1c9220bc3%26messageContent%3D Testing%25123%26recipients%3D6010xxxxxxx%26referenceID%3Dba63ht12opab6
* **Multiple recipients**\
  &#x20;https%3A%2F%2Fapp-sms.online-live-support.com%2Fapi%2Fsend.php%3F apiKey%3D22f277843206d477d3cd4ae1c9220bc3%26messageContent%3D Testing%25123%26recipients%3D6010xxxxxxx%3B6012xxxxxxx%26referenceID%3Diyr340hbc6ja0b

**Response**

* **Single recipient - Successful**\
  &#x20;{"status":"ok","msgCode":"E00001","statusMsg":"Completed successfully.","referenceID":\["q5c502192aa869"],"balance":8901,"data":\[{"recipients":"6010xxxxxxx","referenceID":"q5c502192aa869"}]}
* **Multiple recipients - Successful**\
  &#x20;{"status":"ok","msgCode":"E00001","statusMsg":"Completed successfully.","referenceID":\["q5c5021c306a95","q5c5021c306ae8"],"balance":8901,"data":\[{"recipients":"6010xxxxxxx","referenceID":"q5c5021c306a95"},{"recipients":"6012xxxxxxx","referenceID":"q5c5021c306ae8"}]}
* **Unsuccessful**\
  &#x20;{"status":"error","msgCode":"E00242","statusMsg":"invalid recipient(s).","invalidRecipients":\["6010999999999"]}

\*Response array encoded with **JSON**<br>

## Status Code List

| Status Code | Description                                          |
| ----------- | ---------------------------------------------------- |
| E00001      | Completed successfully.                              |
| E00081      | Account not active yet. Please contact our support.  |
| E00242      | Invalid recipient(s).                                |
| E00243      | Please enter your message.                           |
| E00249      | Maximum 10 SMS per recipient(s).                     |
| E00248      | Please enter at least one recipient.                 |
| E00250      | Insufficient balance.                                |
| E00253      | Maximum 100 recipient(s).                            |
| E00359      | Invalid API Key.                                     |
| E00366      | The message content contains international brand(s). |
| BE00035     | The message not allow to send without company name.  |
| BE00036     | The message not allow to send without whitelisted.   |
| BE00096     | Duplicated reference id found.                       |
| BE00128     | Completed successfully(low balance).                 |


# POST Add Template through API

Post details are as below:

```
https://app-sms.online-live-support.com/api/api/smsAddTemplate.php
```

Variable should be passed in with format below:&#x20;

Sample Data In

```
{"apiKey ":"abc88888888acbde","email":"xxxx@gmail.com","templateTitle":" AddTemplate02Jun2020","messageContent":"Hi, add template through api on 02 June 2020.","referenceId":"567890"}
```

* | Param          | Data Type | Description                                                                                                   | Sample                                        |
  | -------------- | --------- | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
  | apiKey         | Varchar   | API Key. (Find your API key at <https://app-sms.online-live-support.com/dashboard.php> My Account > Settings) | abc88888888acbde                              |
  | email          | Varchar   | Email. (Find your API key at <https://app-sms.online-live-support.com/dashboard.php> My Account > Settings)   | <xxxx@gmail.com>                              |
  | templateTitle  | Varchar   | Template title to be add                                                                                      | AddTemplate02Jun2020                          |
  | messageContent | Text      | Message content wanted to submit for whitelist                                                                | Hi, add template through api on 02 June 2020. |
  | referenceId    | Varchar   | Reference ID to be return for you when status callback                                                        | <p>567890<br></p>                             |
* To be more secure, only POST method is accepted, GET method will not be accepted.\
  \
  \*\* apiKey, email, templateTitle and messageContent is necessary to pass in, but referenceId is not compulsary. If referenceId is passed from your site, we will return the same referenceId when callback for template status.\
  \*\* Add template through API will be consider as submitted.

## Return submitted template status to client site

* Perform steps below to allow callback status after we approved or rejected your template:<br>

  1. **Pass your return URL to u**\
     For example: <https://app-sms.online-live-support.com/callback/receiveCallbackStatus.php\\>
     &#x20;<https://app-sms.online-live-support.com> => \[website URL]\
     &#x20;callback/receiveCallbackStatus.php => \[file path]
  2. **Tick the checkbox** name as "Enable SMS Add Template Status Callback" at settings -> SMS Template Status Through API Callback section

* Details below will be returned:\
  &#x20;**Sample Data Return**

```
 {"action":"templateStatusCallback","actionCode":"E00101","status":"Approved"," messageContent":"Hi, add template through api on 02 June 2020.","referenceId":"567890"}
```

* | Param          | Data Type | Description                                        | Sample                                        |
  | -------------- | --------- | -------------------------------------------------- | --------------------------------------------- |
  | action         | String    | Return command                                     | templateStatusCallback                        |
  | actionCode     | String    | Return Code                                        | E00101                                        |
  | status         | String    | Template status                                    | Approved                                      |
  | messageContent | String    | Whitelisted message content                        | Hi, add template through api on 02 June 2020. |
  | referenceId    | String    | Reference ID you passed to us when submit template | 567890                                        |

  \
  \*Response array encoded with **JSON**

#### **Status Code List**

| Status Code | Description |
| ----------- | ----------- |
| E00101      | Approved    |
| E00102      | Rejected    |
| E00103      | Others      |


# GET method to get Account Balance

```
https://app-sms.online-live-support.com/api/getBalance.php?apiKey=[APIKEY]&email=[EMAIL]
```

| \[APIKEY] | API Key. (Find your API key at [https://app-sms.online-live-support.com/dashboard.php ](<https://app-sms.online-live-support.com/dashboard.php >) My Account > Settings) |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| \[EMAIL]  | Email. (Find your API key at [https://app-sms.online-live-support.com/dashboard.php ](<https://app-sms.online-live-support.com/dashboard.php >) My Account > Settings)   |

## **Request and Response format**

**Request**

<https://app-sms.online-live-support.com/api/getBalance.php?apiKey=\\[APIKEY]\\&email=\\[EMAIL>]

**Response**

{"status":"\[STATUS]","msgCode":"\[MSGCODE]","statusMsg":"\[ STATUSMSG]"," balance":"\[ BALANCE]"}\
\
&#x20;\*Response array encoded with **JSON**

## **Example code for request and response**

**Request**

```
https://app-sms.online-live-support.com/api/getBalance.php?apiKey=e0323drabst6728725da3dvdcra78910a&email=abcd1234@gmail.com
```

**Response**

```
{"status":"ok","msgCode":"E00001","statusMsg":"Completed successfully.","balance":"120.22"}
```

## **Status Code List**

| Status Code | Description |
| ----------- | ----------- |

| E00001 | Completed successfully. |
| ------ | ----------------------- |


# Create Group & Bulk Upload contacts

Here is the details how you can Create Group and Bulk upload contact via CSV

## [How to Send Bulk SMS?](/user-manual/how-to-send-bulk-sms)Step 1: Prepare your CSV&#x20;

Click on Phone Book and download the sample file&#x20;

Make sure to follow the same format as sample file to add your participant details

<figure><img src="https://2108185336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk5XfjopEvyjP7112oI%2Fuploads%2FI8O8Trl0hQDOYX3UpMrp%2Fimage.png?alt=media&amp;token=49d8a37a-6482-4b5a-a55a-691df3c3e5d8" alt=""><figcaption></figcaption></figure>

## Step 2: Upload CSV

Choose a file and upload your CSV (which you have prepared from the Step 1)

Give name to the group and click on "Import"

<figure><img src="https://2108185336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk5XfjopEvyjP7112oI%2Fuploads%2FsLOpHB2wTombXNwIsfH3%2Fimage.png?alt=media&amp;token=ff635d74-651f-4e67-86e7-15195e27eebb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2108185336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk5XfjopEvyjP7112oI%2Fuploads%2FisHA7nlv32NcIYIBNulk%2Fimage.png?alt=media&amp;token=5a20224a-d406-4c22-9cb5-836b10f6e80a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Next: How to Send Bulk SMS?
{% endhint %}


# How to Send Bulk SMS?

Note: If you haven't purchase the package, please purchase it first from SMSBlastMalaysia.com or WhatsApp for Support: +60 11-5954 3635

## **Step 1** - Login on Dashboard

<https://app-sms.online-live-support.com/login.php>

<figure><img src="https://2108185336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk5XfjopEvyjP7112oI%2Fuploads%2F2cPiFnBIoKWzhuA3EKj0%2Fimage.png?alt=media&amp;token=c685ec13-1e30-4c3e-b508-f0bb0406032e" alt=""><figcaption></figcaption></figure>

## Step 2 - Bulk Send&#x20;

1. Click on **Bulk Send**&#x20;
2. Enter **Campaign Name**
3. **Select Group**&#x20;
4. **Select Template** -> Select type of **Schedule** NOW VS specific Time and click **Send**

<figure><img src="https://2108185336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk5XfjopEvyjP7112oI%2Fuploads%2FXCfZeVdzxyreejbHPoOB%2Fimage.png?alt=media&amp;token=f75c1417-084d-4261-be59-39212796bfb7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2108185336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk5XfjopEvyjP7112oI%2Fuploads%2FZU5qSnmFa3O05mUEuPbn%2Fimage.png?alt=media&amp;token=784b5498-c313-4ac1-800f-b17a2c80da21" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Make sure to get approval first for your SMS template message. Share your SMS template with support before sending it to whitelist the SMS.&#x20;

**WhatsApp for Support**: +60 11-5954 3635
{% endhint %}


