///////////////////////// LOGIC OF ID MAINTAINED IN INTERACTIVE MESSAGES JSON //////////////////////////// ALWAYS STARTS WITH ID '0' LEVEL 1 OPTIONS WILL HAVE IDs LIKE 1, 2, 3, 4, ..... LEVEL 2: IF 1 IS SELECTED IN LEVEL 1, IDs WILL BE LIKE 1-1, 1-2, 1-3, ..... IF 3 IS SELECTED IN LEVEL 1, IDs WILL BE LIKE 3-1, 3-2, 3-3, ..... IF THERE ARE NO FURTHER OPTIONS AVAILABLE, SUFFIX -0 TO ID. FOR EXAMPLE, IF 1-3 OPTION OF LEVEL 2 DOES NOT HAVE FURTHER OPTIONS, ID WILL BE REPLACED AS 1-3-0. GENERAL MESSAGE: JSON WILL HAVE ID 'GENRAL' TO SEND GENERALISED MESSAGE WHEN ID NOT FOUND. FOR EXAMPLE, IF 1-3-0 ID CONTENT NOT FOUND, CAN SEND THIS GENERALISED MESSAGE. ///////////////////////// INTERACTIVE MESSAGE FORMAT //////////////////////////// /* FOR LIST INTERACTIVE MESSAGES LIMITATIONS: 1. UPTO 10 LIST VALUES CAN BE ADDED 2. CHARACTER LIMIT OF OPTION/ROW ID: 200 3. CHARACTER LIMIT OF OPTION/ROW TITLE: 24 4. CHARACTER LIMIT OF OPTION/ROW DESCTIPTION: */ { "type": "list", "header": { "type": "text", "text": "your-header-content" }, "body": { "text": "your-text-message-content" }, "footer": { "text": "your-footer-content" }, "action": { "button": "cta-button-content", "sections":[ { "title":"your-section-title-content", "rows": [ { "id":"unique-row-identifier", "title": "row-title-content", "description": "row-description-content", , { "id":"unique-row-identifier", "title": "row-title-content", "description": "row-description-content", } ] }, { "title":"your-section-title-content", "rows": [ { "id":"unique-row-identifier", "title": "row-title-content", "description": "row-description-content", } ] }, ... ] } } /* FOR BUTTON INTERACTIVE MESSAGES LIMITATIONS: 1. UPTO 3 BUTTONS CAN BE ADDED 2. CHARACTER LIMIT OF OPTION/ROW ID: 256 3. CHARACTER LIMIT OF OPTION/ROW TITLE: 20 */ { "type": "button", "header": { "type": "text"", "text": "your text" }, "body": { "text": "your-text-body-content" }, "footer": { "text": "your-text-footer-content" }, "action": { "buttons": [ { "type": "reply", "reply": { "id": "unique-postback-id", "title": "First Button’s Title" } }, { "type": "reply", "reply": { "id": "unique-postback-id", "title": "Second Button’s Title" } } ] } } /* FOR DIRECT INTERACTIVE MESSAGES */ { "type": "direct", "text": "your-text-body-content" } ////////////////////////////////// INBOUNG MESSAGE RECEIVED /////////////////////////// /* NORMAL MESSAGE RECEIVED FORMAT */ { "object": "whatsapp_business_account", "entry": [ { "id": "111248261953172", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "917019188500", "phone_number_id": "105037365916143" }, "contacts": [ { "profile": { "name": "Shruthi" }, "wa_id": "919738463976" } ], "messages": [ { "from": "919738463976", "id": "wamid.HBgMOTE5NzM4NDYzOTc2FQIAEhggRUFCNUVCRkI3MERGNDgwNUIwQThBMjdDM0Y1MEM4NUMA", "timestamp": "1706078953", "text": { "body": "Hi" }, "type": "text" } ] }, "field": "messages" } ] } ] } /* REPLY RECEIVED FOR INTERACTIVE LIST MESSAGE FORMAT */ { "object": "whatsapp_business_account", "entry": [ { "id": "111248261953172", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "917019188500", "phone_number_id": "105037365916143" }, "contacts": [ { "profile": { "name": "Shruthi" }, "wa_id": "919738463976" } ], "messages": [ { "context": { "from": "917019188500", "id": "wamid.HBgMOTE5NzM4NDYzOTc2FQIAERgSRkUzOEVENzI5NThEQzMyRjgyAA==" }, "from": "919738463976", "id": "wamid.HBgMOTE5NzM4NDYzOTc2FQIAEhggMEM3NDExMkQyQkIyQjJGNkY1QTI4OTZFNkQ4MDVGMzcA", "timestamp": "1706540676", "type": "interactive", "interactive": { "type": "list_reply", "list_reply": { "id": "2", "title": "Need support", "description": "Existing customer. Need support" } } } ] }, "field": "messages" } ] } ] } /* REPLY RECEIVED FOR INTERACTIVE BUTTON MESSAGE FORMAT */ { "object": "whatsapp_business_account", "entry": [ { "id": "111248261953172", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "917019188500", "phone_number_id": "105037365916143" }, "contacts": [ { "profile": { "name": "Shruthi" }, "wa_id": "919738463976" } ], "messages": [ { "context": { "from": "917019188500", "id": "wamid.HBgMOTE5NzM4NDYzOTc2FQIAERgSQjY3NEEyMDk3M0ZEOTM5RTUzAA==" }, "from": "919738463976", "id": "wamid.HBgMOTE5NzM4NDYzOTc2FQIAEhggRTQyMzk4RDU4MkM4OTQ1NTJFMkUzRTI3ODJEQ0Q4NTQA", "timestamp": "1706540714", "type": "interactive", "interactive": { "type": "button_reply", "button_reply": { "id": "2-1-0", "title": "I have an SR Number" } } } ] }, "field": "messages" } ] } ] }