Event catalog
Every event arrives with the same three-key envelope. What changes from one to another is type and the shape of data.
2 min read
The envelope
The body of every notification is a JSON object with exactly these three keys, in this order:
| Key | Type | What it is |
|---|---|---|
id | string | Event identifier. It stays the same across every retry and every one of your endpoints. For sms. it is 32 lowercase hexadecimal characters. |
type | string | Event type. It also arrives in the X-Hablame-Event-Type header. |
data | object | The event data. Its shape depends on type and is described in the event catalog. |
Read keys by name and do not reject an event because data carries a key you do not know.
Event types
| Type | When it arrives | Details |
|---|---|---|
sms. | Someone sent an SMS to your short code. | Inbound SMS |
How the type is built
The type is lowercase, made of letters, digits and separators (., _ or -), with no spaces. When it has a variable part, such as the short code in sms., that part goes at the end: an SMS sent to 87654 carries the type sms., both in type and in the X-Hablame-Event-Type header.