Send a message
Creates a new message object. BSG returns the created message object with each request. Per request, a max of 50 phones can be entered.
REQUIRED PARAMETERS
Parameter |
Type |
Description |
destination |
string |
The type of message campaign. Required
Values can be:
phone (single message reuest).
phones (multiple message reuest). |
originator |
string |
The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In case of an alphanumeric string, the maximum length is 11 characters. Required |
body |
string |
The body of the SMS message. Required |
msisdn |
string |
The telephone number. Required |
reference |
string |
A client reference. Required |
phones |
array |
The array of recipients msisdn's & reference's. Required Set only for multiple message request ("destination": "phones"). |
OPTIONAL PARAMETERS
Parameter |
Type |
Description |
validity |
int |
The amount of seconds that the message is valid. |
tariff |
int |
Tariff code of a price grid. |
DEFINITION
PUT (POST) https://app.bsg.hk/rest/sms/create
RETURNS
Returns a message object if the request was successful. If the request failed, an error object will be returned.
EXAMPLE REQUEST (SINGLE MESSAGE)
{
"destination":"phone",
"originator":"alpha name",
"body":"message text",
"msisdn":"380972000000",
"reference":"ext_id_16",
"validity":"1",
"tariff":"0"
}
EXAMPLE RESPONSE (SINGLE MESSAGE)
{
"result":{
"error":0,
"errorDescription":"No errors",
"reference":"ext_id_16",
"id":"213",
"price":0.23,
"currency":"EUR"
}
}
EXAMPLE REQUEST (MULTIPLE MESSAGES)
{
"validity":"1",
"tariff":"0",
"destination":"phones",
"originator":"alpha_name",
"body":"message text",
"phones":[
{
"msisdn":"380972000000",
"reference":"ext_id_17"
},
{
"msisdn":"380972000001",
"reference":"ext_id_18"
}
]
}
ATTRIBUTES
Attribute |
Type |
Description |
task_id |
int |
An unique random ID which is created for multiple request. |
EXAMPLE RESPONSE (MULTIPLE MESSAGES)
{
"task_id":"6",
"result":[
{
"error":0,
"errorDescription":"No errors",
"reference":"ext_id_17",
"id":"214",
"price":0.23,
"currency":"EUR"
},
{
"error":0,
"errorDescription":"No errors",
"reference":"ext_id_18",
"id":"215",
"price":0.23,
"currency":"EUR"
}
],
"total_price":0.46,
"currency":"EUR"
}