Inform Customers of Their Order and Delivery Status
Through the Infobip platform, you can send various messages to your end users using API and different channels.
This tutorial explains how to send notifications to your end users about shipment after they've made a purchase. We've used Viber as our communication channel and SMS as a failover scenario. SMS will be sent in case the customer doesn’t have Viber installed as an application on their device.
Process Workflow
NOTE
Before you start communicating with your customers over Viber, you must obtain and store their opt-ins.
IMPLEMENTATION STEPS
In particular, this use case can be implemented two ways. Via API or via our web interface using Moments, People, Viber, and SMS as a failover channel.
Steps over API
-
Log in to the Infobip API Resource hub and copy your base URL. It is visible on top of the page below the API Key.
BASE URL
The personal BASE URL is a simple way to identify who sent out the API request. This means we can identify the request through DNS and then find the optimal route for API requests.
2. To create a request, use Postman or a similar API development tool, then choose the POST method.
3. Replace the endpoint with your Base URL and then add the following to that URL: ''.api.infobip.com/omni/1/advanced''
4. Add the Authorization header. For example, Basic: Base64 encoded username and password. Learn more about Authentication in our API documentation.
5. Copy the scenarioKey
you previously created. Learn more about Creating a scenario.
6. Using the JSON request example provided below, specify the destination phoneNumber you wish to send the notification to.
7. Enter the Viber text
(include the link), imageURL
, buttonText
and buttonURL
values.
8. Enter the SMS text
value and provide the authorization link.
9. Send your message. If successful, the response header HTTP status code will be 200
.
{
"scenarioKey":"ABD3424C690F0D706",
"destinations":[
{
"to":{
"phoneNumber": "79123456789"
}
}
],
"viber": {
"text": "Order #15034 is waiting to be picked-up at the shop address: White street 2 until 31.12.2020. To get the order - open link Example.com/QR or scan QR code at terminal",
"imageURL": "infobip.com/image/example.png",
"buttonText": "Get your order",
"buttonURL": "http://www.infobip.com/",
"isPromotional": true
},
"sms": {
"text": "Order #15034 is waiting to be picked-up at the shop address: White street 2 until 31.12.2020. To get the order - open link Example.com/QR and scan QR code at terminal"
}
}