Notification

You can send a notification to the user as an optional combined notification. The current supported channels are SMS and Whatsapp notification.

In this part, we will send a Notification based on the Failover Order.

Request

The request contains channel notification payloads.

Curl Example

                            
                            curl --location --request POST 'https://api.motict.com/v1/combined/notification/failover' \
                            --header 'Authorization: api_key' \
                            --header 'Content-Type: application/json' \
                            --data-raw '{
                                "whatsapp": {
                                    "from": "+628123456789",
                                    "to": "+628123456781",
                                    "type": "template",
                                    "template": {
                                        "name": "5f0b5191-7093-45b4-962f-f2943adec77b",
                                        "language": {
                                            "policy": "deterministic",
                                            "code": "id"
                                        },
                                        "components": [
                                            {
                                                "type": "body",
                                                "parameters": [
                                                    {
                                                        "type": "text",
                                                        "text": "1234"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                },
                                "sms": {
                                    "phone_number":"+628123456781",
                                    "message":"Status servis Anda, XX/YY/12345 telah diproses."
                                }
                            }'
                            
                        

Parameters

Name Type Required Description
api_key String Yes API key credential will be provided by Motict team.
whatsapp String Yes Check the detail on Whatsapp Text Template
sms String Yes Check the detail on SMS Notification

Response

The response contains JSON body with message status whether the request is success or error. And also the status of the notification channel.

Body

                            
                            {
                                "message": "success",
                                "data": {
                                    "request_id": "896e88e1-8ce1-4248-921b-9513ea65fcb2",
                                    "result": {
                                        "sms": {
                                            "status": "failover"
                                        },
                                        "whatsapp": {
                                            "status": "requested"
                                        }
                                    }
                                }
                            }
                            
                        

Parameters

Name Type Description
request_id String Request ID will be used as notification identifier for each request
result String Result of the notication channel whether it requested or as the failover.
message String Success or error message