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.

{
    "messages": [
        {
            "profile": {
                "name": "iSlash"
            },
            "wa_id": "85256872847",
            "from": "85256872847",
            "id": "ABGGhSlIRoQvAgo-sL8KNOJ1WUnK",
            "text": {
                "body": "testing"
            },
            "type": "text",
            "sequence": "35500920",
            "timestamp": "1649756854"
        }
    ]
}

Other Message Status

Please refer to https://developers.facebook.com/docs/whatsapp/api/webhooks/inbound for other incoming message types.

{
    "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"
        }
    ]
}

Last updated