Events and Report
Introduction
Events are our way of letting you know when something happens on your account. When an event occurs, we create an Event object.
Verifying events
It is important to verify that an event originated from Termii.
You can verify an event by validating the signature, a valid event is raised with an header X-Termii-Signature which is a HMAC SHA512 signature of the event payload signed with your secret key.
Outbound Message
An outbound message is a message routed from a client or an application and delivered to the end user's mobile phone. You can receive the outbound message status update reports directly in your application using Termii's Webhook Notiifcation. Add your webhook url in your termii developer console
Request Type :
POST
Content-Type : application/json
| Options | Description |
|---|---|
| type | string Represents the type of message that is sent |
| id | string Represents the ID of the request sent |
| message_id | string Represents the ID of the message sent |
| receiver | string Represents the destination phone number |
| sender | string Represents a sender ID for sms or Device ID for Whatsapp which can be Alphanumeric |
| message | string Text of a message that would be sent to the destination phone number |
| sent_at | string Represents the time the message was sent |
| cost | string Represent amount charged for the message sent |
| status | string Represents the status of the message sent.v A message can have any of the following states; DELIVERED | Message delivered to handset, DND Active on Phone Number, Message Failed |
| channel | string This is the route through which the message is sent. It is either dnd, whatsapp, or generic |
Device offline Notification
You can receive your device offline notification update directly in your application using Termii's Webhook Notiifcation. Add your webhook url in your termii developer console
Request Type :
POST
Content-Type : application/json
| Options | Description |
|---|---|
| type | string Represents the type of request that is sent |
| status | string Represents the current status of the device |
| device_id | string Represents the ID of the device |
| name | string Represents the name of the device |
{
"type":"device_status",
"status":"disconnected",
"device_id":"e0c5a9b-0136-4751-9be9-a3c9zzTc0a19",
"name":"TermiiWh"
}