netflie / whatsapp-cloud-api

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform
https://netflie.es/portfolio/whatsapp-business-cloud-api-php-sdk/
MIT License
484 stars 177 forks source link

adding flow message support #197

Closed pravnyadv closed 3 months ago

pravnyadv commented 5 months ago

Added support for flow message

image

tested on payload below

{
    "object": "whatsapp_business_account",
    "entry": [{
        "id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
        "changes": [{
            "value": {
                "messaging_product": "whatsapp",
                "metadata": {
                    "display_phone_number": "PHONE_NUMBER",
                    "phone_number_id": "PHONE_NUMBER_ID"
                },
                "contacts": [{
                    "profile": {
                        "name": "NAME"
                    },
                    "wa_id": "WHATSAPP_ID"
                }],
                "messages": [{
                    "context": {
                        "from": "PHONE_NUMBER",
                        "id": "wamid.ID"
                    },
                    "from": "16315551234",
                    "id": "wamid.ID",
                    "timestamp": 1669233778,
                    "type": "interactive",
                    "interactive": {
                        "type": "nfm_reply",
                        "nfm_reply": {
                            "response_json": "{\"screen_0_name_0\":\"EMAIL\",\"screen_0_orderNumber_1\":\"ORDER_NUMBER\",\"screen_0_topicRadio_2\":\"TOPIC\",\"screen_0_DatePicker_3\":\"DATE_PICKER_TIMESTAMP\",\"flow_token\":\"unused\"}",
                            "body": "BODY",
                            "name": "flow"
                        }
                    }
                }]
            },
            "field": "messages"
        }]
    }]
}
renan-rmp commented 4 months ago

Any update on this issue ?

pravnyadv commented 3 months ago

@aalbarca can you please draft a new release so i can pull updated code from composer?