The method allows sending an SMS.
Creating single SMS (“destination”:”phone”), bulk messaging (“destination”:”phones”) and customized SMS (“destination”:”individual”) are supported.
To send campaign, make a request to this URL:
| PUT (POST) https://api.bsg.world/rest/sms/create |
| Parameter | Required | Type | Description |
|---|---|---|---|
| destination | Yes | string | set to “phone” |
| originator | Yes | string | sender. String up to 14 characters |
| body | Yes | string | SMS message text |
| msisdn | Yes | string | phone number to which the SMS is sent |
| reference | No | string | SMS external ID. String up to 32 characters containing /a-zA-Z0-9/ |
| validity | No | integer | SMS validity time. The default is 72 hours. Integer from 1 to 72 |
| tariff | No | integer | tariff number. The default is 0. Integer from 0 to 9 |
| 2way | No | bool | belonging to 2WAY |
{
"destination":"phone",
"msisdn": "380501234567",
"reference": "reference_id",
"originator": "sender",
"body":"test sms",
"2way": 1
}
| Parameter | Type | Description |
|---|---|---|
| id | integer | the message ID, a unique random identifier that is created on the BSG platform when an object is created |
| reference | string | SMS external ID |
| price | float | SMS price |
| currency | string | сurrency in which the SMS price is specified |
If the request is successful, you will receive a response:
{
"error":"0",
"id":"22125",
"reference":"12erdgm9",
"price":"0.02",
"currency":"EUR"
}
Bulk SMS campaign contains one text for all recipient numbers.
| Parameter | Required | Type | Descripton |
| destination | Yes | string | set to “phones” |
| phones | Yes | array | values array |
| msisdn | Yes | string | phone number to which the SMS is sent |
| reference | No | string | SMS external ID. String up to 32 characters containing /a-zA-Z0-9/ |
| originator | Yes | string | Sender name. String up to 14 characters |
| body | Yes | string | SMS message text |
| validity | No | integer | SMS validity time. The default is 72 hours. Integer from 1 to 72 |
| tariff | No | integer | tariff number. The default is 0. Integer from 0 to 9 |
| 2way | No | bool | belonging to 2WAY |
| Parameter | Type | Description |
|---|---|---|
| id | integer | SMS ID |
| reference | string | SMS external ID |
| price | float | SMS price |
| currency | string | сurrency in which the SMS price is specified |
| task_id | integer |
Campaign ID, which is generated automatically by the system when creating a campaign.
The task_id parameter is used to request the status of the entire campaign |
If the request is successful, you will receive a response:
| Parameter | Required | Type | Description |
|---|---|---|---|
| destination | Yes | string | set to “individual” |
| validity | No | integer | SMS validity time. The default is 72 hours. Integer from 1 to 72 |
| tariff | No | integer | tariff number. The default is 0. Integer from 0 to 9 |
| 2way | No | bool | belonging to 2WAY |
| phones | Yes | array | values array |
| msisdn | Yes | string | phone number to which the SMS is sent |
| reference | No | string | SMS external ID. String up to 32 characters containing /a-zA-Z0-9/ |
| originator | Yes | string | Sender name. String up to 14 characters |
| body | Yes | string | SMS message text |
{
"destination":"phones",
"phones":[
{"msisdn": "380972000001","reference":"12erdgm9"},
{"msisdn": "380972000002","reference":"12erdgn0"}
],
"originator":"test",
"body":"test sms",
"validity": 72,
"tariff":9
}
| Parameter | Type | Description |
|---|---|---|
| id | integer | SMS ID |
| reference | string | SMS external ID |
| price | float | SMS price |
| currency | string | сurrency in which the SMS price is specified |
| total price | float | total campaign price. |
| currency | string | сurrency in which the camapign price is specified |
If the request is successful, you will receive a response:
{
"result":
[
{"reference":"12erdgm9",
"id":"12345",
"error":"0",
"price":"0.02",
"currency":"EUR"},
{"reference":"12erdgn0",
"id":"12346",
"error":"0",
"price":"0.02",
"currency":"EUR"}
],
"error":"0",
"task_id":"21902"
}