WhatsApp Channel When there are new incoming messages, or message status is updated (e.g., sent, read), iSlash will post data to the Webhook URL.
Incoming
The webhook format is very similar to the official API (https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound#text-message ), except the profile, wa_id is not wrapped within contacts, and from, id, timestamp, text\=, type is not wrapped in messages. If the incoming messages have the same timestamp, you may then use the sequence number to distinguish the sequence. Earlier incoming messages with same timestamp will have smaller sequence.
Incoming Text Message Incoming Image Message
Copy {
"messages" : [
{
"profile" : {
"name" : "iSlash"
} ,
"wa_id" : "85256872847" ,
"from" : "85256872847" ,
"id" : "ABGGhSlIRoQvAgo-sL8KNOJ1WUnK" ,
"text" : {
"body" : "testing"
} ,
"type" : "text" ,
"sequence" : "35500920" ,
"timestamp" : "1649756854"
}
]
}
Copy {
"messages" : [
{
"image" : {
"sha256" : "5b743dde51ec4e888f1b16e9773bafc2a36a4f0e729f2e6f60017623b9fb6069" ,
"mime_type" : "image/jpeg" ,
"id" : "5774c685-a393-42d9-a0d2-8e9c57690348"
} ,
"profile" : {
"name" : "iSlash"
} ,
"wa_id" : "85256872847" ,
"from" : "85256872847" ,
"id" : "ABGGhSlIRoQvAgo-sB6rm0wvh_fz" ,
"type" : "image" ,
"sequence" : "35546638" ,
"timestamp" : "1649834056"
}
]
}
Other Message Status
Please refer to https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound for other incoming message types.
Sent Delivered Read Failed to send message
Copy {
"statuses" : [
{
"sequence" : "35525319" ,
"id" : "gBGGhSlIRoQvAgkGNTcduk8W2CQ" ,
"type" : "message" ,
"conversation" : {
"origin" : {
"type" : "user_initiated"
} ,
"id" : "061ce662fd6f2580cee660e12d5db606"
} ,
"pricing" : {
"pricing_model" : "CBP" ,
"category" : "user_initiated" ,
"billable" : true
} ,
"recipient_id" : "85256872847" ,
"status" : "delivered" ,
"timestamp" : "1649812397"
}
]
}
Copy {
"statuses" : [
{
"sequence" : "35525319" ,
"id" : "gBGGhSlIRoQvAgkGNTcduk8W2CQ" ,
"type" : "message" ,
"conversation" : {
"origin" : {
"type" : "user_initiated"
} ,
"id" : "061ce662fd6f2580cee660e12d5db606"
} ,
"pricing" : {
"pricing_model" : "CBP" ,
"category" : "user_initiated" ,
"billable" : true
} ,
"recipient_id" : "85256872847" ,
"status" : "delivered" ,
"timestamp" : "1649812397"
}
]
}
Copy {
"statuses" : [
{
"sequence" : "35525462" ,
"id" : "gBGGhSlIRoQvAgkGNTcduk8W2CQ" ,
"type" : "message" ,
"recipient_id" : "85256872847" ,
"status" : "read" ,
"timestamp" : "1649812784"
}
]
}
Copy {
"statuses" : [
{
"sequence" : "35526170" ,
"id" : "gBGGhSlIRoQvAglgL8ey5qg79Q0" ,
"type" : "message" ,
"errors" : [
{
"code" : 1000 ,
"title" : "Error message..."
}
] ,
"recipient_id" : "85256872847" ,
"status" : "failed" ,
"timestamp" : "1649814170"
}
]
}
Last updated 5 months ago