- Products
- Solutions
PUT (POST is also supported) /sms/create
Single SMS creation supported (“destination”:”phone”), mass sending (“destination”:”phones”) and individual sms ((“destination”:”individual”). In the future, the ability to create API mailing lists from the address book will be added (“destination”:”addressbook”).
Sample code:
PUT (POST)
Endpoint URL: https://api.affiliate-sms.com/rest/sms/create
Header:
X-API-KEY: live_qwefqw41234
Content-type: application/json
JSON Body RAW:
{
"originator ":"test",
"body":"test sms",
"validity": 72,
"tariff":9,
"destination":"phone",
"msisdn": "380972000000",
"reference":"12erdgm9",
"send_time" : "ISO 8601 date"
}
The following parameters are passed:
Required:
Optional:
In this case, example of the correct response / 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",
"totalprice":"0.04",
"currency":"EUR",
"task_id":"21902"
}
The task_id parameter is intended for the status request on the entire messaging.
If the data contains an error, a response will be returned approximately as follows:
{
"error":"25",
"errorDescription":"Invalid originator"
}
{
"validity": 72,
"tariff":9,
"destination":"individual",
"phones":
[
{"originator":"test1",
"body":"test sms1",
"msisdn":"380972000001",
"reference": "12erdgm9"},
{"originator":"test2",
"body":"test sms2",
"msisdn": "380972000002",
"reference": "12erdgn0"}
],
"scheduledDatetime" : "ISO 8601 date"
}
The following parameters are passed (optional are italicised):
In this case, example of the correct 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",
"totalprice":"0.04",
"currency":"EUR",
"task_id":"21902"}
}
The task_id parameter is intended for the status request on the entire messaging.
The task_id parameter is used to request status throughout the mailing list.
If there is an error in the data, a response of approximately this type will be returned:
{
"error":"24",
"errorDescription":"Invalid request payload"
}