Alat WA uses outgoing webhooks that send data from Alat WA to external services. When an event occurs, data is sent to the registered URL.
When a webhook is triggered, the data received is in the following format:
Receive Message
Method: POST
Headers: "Content-Type: application/json"
Body: {
"device": "Device ID",
"data": {
"message_id": "string",
"related_message_id": "string",
"type": "string",
"sender_name": "string",
"sender": "string",
"receiver": "string",
"message": "string",
"media_url": "string",
"author": "string",
"created": integer
}
}
{
"device": "888111222133155555",
"data": {
"message_id": "3FC022B1851111839",
"related_message_id": "",
"type": "text",
"sender_name": "John",
"sender": "628123123123",
"receiver": "6289669342954",
"message": "tes message",
"media_url": null,
"author": null,
"created": 1734656438
}
}
{
"device": "888111222133155555",
"data": {
"message_id": "3FC022B18511113333",
"related_message_id": "",
"type": "text",
"sender_name": "John",
"sender": "628123123123",
"receiver": "6289669342954",
"message": "tes message",
"media_url": "https://media.alatwa.com/assets/uploads/customer/default.jpg",
"author": null,
"created": 1734656438
}
}
{
"device": "888111222133155555",
"data": {
"message_id": "3FC022B18511112222",
"related_message_id": "",
"type": "text",
"sender_name": "John",
"sender": "120363045611111111",
"receiver": "6289669342954",
"message": "tes message",
"media_url": null,
"author": "628123123123",
"created": 1734656438
}
}
Status Message
{
"device": "Device ID",
"data": {
"message_id": "string",
"status_code": integer,
"status": "string",
"created": integer
}
}
{
"device": "888111222133155555",
"data": {
"message_id": "PEFPYI2CPQWWV11111111",
"status_code": 4,
"status": "Read",
"created": 1734657859
}
}
QR Code for scan device
{
"device_id": "Device ID",
"qr": "string"
}
{
"device_id": "888111222133155555",
"qr": "2@b5g96Bi11111MrW21aw5yufcccToZQDIAzaNIe\/gSwTB84Ylqqk8U0h5sJKcXWIS9k=,tp5Y3LtUR6aoWy+B4XLBAzbnYfEMuRnOdUt0bvTy2Vo=,6uTGIxJM7MchiW3f39KkfvT46KlBO1YeEJgaU+HDMAo=,kIBq8PDfRG7vkbDc4LACo2GEPVwbjFoDY3Owy7F77vI="
}
Device Connected
{
"device_id": "Device ID",
"status": "string"
}
{
"device_id": "888111222133155555",
"status": "connected"
}
Device Disconnect
{
"device_id": "Device ID",
"status": "string"
}
{
"device_id": "888111222133155555",
"status": "disconnect"
}