# Send SMS (POST API)

## Send SMS

<mark style="color:green;">`POST`</mark> `<base_url>/bulk-sms`

This endpoint allows you to send SMS.

#### Headers

| Name          | Type   | Description                     |
| ------------- | ------ | ------------------------------- |
| Authorization | string | Your API key in request header. |

#### Request Body

| Name             | Type    | Description                                                                                                                                                                                                                                                                   |
| ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| is\_confidential | boolean | <p>0 - Send as Normal SMS<br>1 - Send as Confidential SMS<br><br>Read more on Confidential SMS section (<https://apidocs.saino.io/sms-api/send-sms-post-api>).</p>                                                                                                            |
| dltTemplateId    | number  | Only for India, If you want to pass directly template id via API you can do that with this parameter., update Entity under Saino app profile section. For more info open below link - <https://help.saino.io/registration-on-dlt-india#how-to-add-template-on-saino-platform> |
| reportUrl        | string  | <p>The URL at which the SMS reports will be sent for this campaign. <br><br><em>Read Reports & Deliveries section below for more information.</em></p>                                                                                                                        |
| senderid         | string  | The registered and approved Sender name.                                                                                                                                                                                                                                      |
| route            | string  | Type of connectivity ex Global, Promotional, Transactional, etc.                                                                                                                                                                                                              |
| number           | string  | Number with country prefix. (multiple numbers can be separated by comma.)                                                                                                                                                                                                     |
| message          | string  | SMS text body. The actual message.                                                                                                                                                                                                                                            |
| unicode          | number  | Message can be send in any language ( Values 1 or 0 )                                                                                                                                                                                                                         |
| time             | string  | Schedule time (in format i.e, yyyy-mm-dd hh:mm:ss) at which the SMS has to be sent                                                                                                                                                                                            |
| flash            | number  | Send flash SMS via API ( Values 1 or 0 )                                                                                                                                                                                                                                      |

{% tabs %}
{% tab title="200 SMS sent successfully.

campaignId : This ID is the reference ID of your request. You can store this ID to capture the deliveries specific to this campaign.  For every request, you will get a new and unique campaignId." %}

```javascript
{
    status: true,
    data: {
        campaignId: 12345
      },
    message: "SMS Sent Successfully."
}
```

{% endtab %}

{% tab title="400 Error in request data." %}

```javascript
{
    status: false,
    message: "Error_Message_For_Root_Cause"
}
```

{% endtab %}
{% endtabs %}

### Reports & Deliveries

In order to get delivery reports directly into your system you need to take care of few simple things.

* Please make sure that, the URL passed in the field `reportUrl`, **must accept** **`HTTP POST`** request with **`JSON`** request body.
* If you wish to get any additional data in the report callback, you should user query parameters and values in the URL itself.

{% hint style="info" %}
If you don't pass the `reportUrl` parameter in request body, we will not be able to push the reports to your system. However, messages will still be delivered to the destination.
{% endhint %}

### Sample Request

{% tabs %}
{% tab title="Request Body" %}

```
{
	"senderid": "SAIFST",
	"route": "Transactional",
	"number": 989XXXXXXX,
	"message": "Hello SainoFirst!! My first Post API.",
	
	// The url at which you want to track the delivery report for this campaign
  "reportUrl": "https://app.sainofirst.com/api-delivery-endpoint?customKey1=CustomValue1&customKey2=CustomValue2" 
}
```

{% endtab %}

{% tab title="Response Body" %}

```
{
    "status": true,
    "data": {
        "campaignId": 12345 // this id should be preserved to track the sms reports.
    },
    "message": "SMS sent successfully."
}
```

{% endtab %}
{% endtabs %}
