Send a VIBER 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 |
---|---|---|
messages | array | The array of VIBER message objects. |
to | array | The array of recipients msisdn's & reference's. |
msisdn | string | The telephone number. |
text | string | The body of the VIBER message. |
alpha_name | string | The sender of the message. |
OPTIONAL PARAMETERS
Parameter | Type | Description |
---|---|---|
validity | int | The amount of seconds that the message is valid. |
tariff | int | Tariff code of a price grid. |
reference | string | A client reference. |
options | hash | An hash with VIBER options. |
DEFINITION
PUT (POST) https://app.bsg.hk/rest/viber/create
RETURNS
Returns a message object if the request was successful. If the request failed, an error object will be returned.
EXAMPLE REQUEST
{
"tariff":"0",
"validity":"1",
"messages":[
{
"to":[
{
"msisdn":"380972920000",
"reference":"ext_id_19"
}
],
"text":"My Viber messages is shinier than your SMS messages",
"alpha_name":"BSG",
"is_promotional":false,
"options":{
"viber":{
"img":"http://mysite.com/logo.png",
"caption":"See Details",
"action":"http://mysite.com/"
}
}
}
]
}
EXAMPLE RESPONSE
{
"result":[
{
"error":0,
"errorDescription":"No errors",
"reference":"ext_id_19",
"id":"217",
"price":0.23,
"currency":"EUR"
}
],
"currency":"EUR",
"total_price":0.23
}
IN ERROR CASE
{
"result":[
{
"error":43,
"errorDescription":"External ID already exists",
"reference":"ext_id_19"
}
]
}