Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Z-API Docs
https://github.com/z-api/z-api-docs
Admin
Z-API Docs provides complete API documentation for developers.
Tokens:
254,633
Snippets:
2,016
Trust Score:
6.5
Update:
4 weeks ago
Context
Chat
Benchmark
80.57
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Install dependencies with npm install Source: https://github.com/z-api/z-api-docs/blob/main/README.md Installs the project dependencies. Run this command in the project root before starting the development server. ```bash $ npm install ``` -------------------------------- ### Get products - JSON response example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/business/get-products.md Example of a successful 200 response from the Get products endpoint, showing the structure of the returned product data. ```json { "cartEnabled": true, "products": [ { "availability": "in stock", "id": "999999999999999", "retailerId": null, "description": "mouse description", "price": "100000", "salePrice": "90000", "currency": "BRL", "name": "Mouse", "quantity": null, "images": ["https://"] } ] } ``` -------------------------------- ### GET /business/profile URL example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/business/profile.md Example URL for the GET request to retrieve business account data. Replace SUA_INSTANCIA and SEU_TOKEN with your instance and token, and provide the phone number as a query parameter. ```http GET https://api.z-api.io/instances/SUA_INSTANCIA/token/SEU_TOKEN/business/profile?phone=5511999999999 ``` -------------------------------- ### Start local development server with npm start Source: https://github.com/z-api/z-api-docs/blob/main/README.md Starts a local development server and opens a browser window. Most changes are reflected live without restarting the server. ```bash $ npm start ``` -------------------------------- ### Start development server in English with npm run start -- --locale en Source: https://github.com/z-api/z-api-docs/blob/main/README.md Starts the development server with the English locale. Use this to develop the English version of the documentation. ```bash $ npm run start -- --locale en ``` -------------------------------- ### Example JSON response for getting a product Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/business/get-product-id.md Shows the structure of a successful response with product details such as availability, id, price, and name. ```json { "cartEnabled": true, "catalogId": "99999999999999999", "product": { "availability": "in stock", "id": "99999999999999", "retailerId": null, "description": "A product description", "price": "20000", "salePrice": "18000", "currency": "BRL", "name": "My first product", "images": ["https://"] } } ``` -------------------------------- ### Response example for GET /profile-picture Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/contacts/get-profile-picture.md Example JSON response returned by the endpoint, containing a link to the contact's picture. ```json [ { "link": "Url with the contact’s picture" } ] ``` -------------------------------- ### List Collections Response Example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/business/list-collections.md Example JSON response from the GET /catalogs/collection endpoint, showing a list of collections with their IDs, names, and statuses, along with a nextCursor token for pagination. ```json { "nextCursor": "AQHRi6eu3NyRTR30t5Sr2CtkURU7rMF_e2K7NPbELxJFAa-K_HI1I6v8_C3o2j6d4wve", "collections": [ { "id": "1072603710847740", "name": "Collection Name", "status": "PENDING" }, { "id": "902834786123343", "name": "Collection Name 2", "status": "APPROVED" } ] } ``` -------------------------------- ### GET /groups Response Example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/group/get-groups.md Example JSON response for a successful 200 request to fetch groups. Shows the structure of a group object with fields like isGroup, name, phone, and muteEndTime. ```json [ { "isGroup": true, "name": "Test Group", "phone": "120263358412332916-group", "unread": "0", "lastMessageTime": "1730918668000", "isMuted": "0", "isMarkedSpam": "false", "archived": "false", "pinned": "false", "muteEndTime": null, "messagesUnread": "0" } ] ``` -------------------------------- ### 200 Response Example for /security/email Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/mobile/set-account-email.md Example success response. The 'message' may be 'VERIFY_EMAIL', requiring an email verification step. ```json { "success": true, "message": "VERIFY_EMAIL" } ``` -------------------------------- ### Response Example for /send-button-otp Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/message/send-button-otp.md Example JSON response with zaapId, messageId, and id fields. ```json { "zaapId": "3999984263738042930CD6ECDE9VDSAW", "messageId": "D241XXXX732339502B68", "id": "D241XXXX732339502B68" } ``` -------------------------------- ### Waiting message return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a waiting message callback. Contains the 'waitingMessage' flag set to true and 'viewOnce' flag. ```json { "isGroup": false, "isNewsletter": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "momment": 1736797729000, "status": "RECEIVED", "fromMe": true, "phone": "5544999999999", "chatName": "chat", "senderName": "name", "senderPhoto": null, "photo": null, "broadcast": false, "participantLid": null, "type": "ReceivedCallback", "waitingMessage": true, "viewOnce": true } ``` -------------------------------- ### Event return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for an event callback. Contains the 'event' object with name, description, cancellation flag, join link, schedule time, and location. ```json { "isStatusReply": false, "senderLid": "81896604192873@lid", "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": true, "isNewsletter": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "120363019502650977-group", "fromMe": false, "momment": 1632228638000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "event": { "name": "Event name", "description": "Event description", "canceled": false, "joinLink": "https://call.whatsapp.com/video/v9123XNFG50L6iO78ndXNvKQr6b45a", "scheduleTime": 1716915653, "location": {} } } ``` -------------------------------- ### Success Response Example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/mobile/request-code.md Example response for a successful code request. Includes wait times for each method and the method used. ```json { "success": true, "retryAfter": 165, "smsWaitSeconds": 125, "voiceWaitSeconds": 125, "waOldWaitSeconds": 125, "method": "sms" } ``` -------------------------------- ### Payment request return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a payment request return callback. Contains notification and notificationParameters fields. ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": true, "momment": 1632230332000, "status": "MESSAGE_RECEIVED", "chatName": "name", "senderName": "name", "participantPhone": "5544999999999", "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "notification": "PAYMENT_ACTION_REQUEST_DECLINED", "notificationParameters": ["5544999999999", "BRL", "1000"], "instanceId": "instance.id" } ``` -------------------------------- ### Payment Request Return Example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example payload for a payment request event received via the On Message Received webhook. ```APIDOC ## Payment Request Return Example ### Description Example payload for a payment request event received via the On Message Received webhook. ### Payload ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": true, "momment": 1632230332000, "status": "MESSAGE_RECEIVED", "chatName": "name", "senderName": "name", "participantPhone": "5544999999999", "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "notification": "PAYMENT_ACTION_REQUEST_DECLINED", "notificationParameters": ["5544999999999", "BRL", "1000"], "instanceId": "instance.id" } ``` ``` -------------------------------- ### Video return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a received video message. Contains fields like waitingMessage, isGroup, instanceId, messageId, phone, fromMe, momment, status, chatName, senderPhoto, senderName, participantPhone, participantLid, photo, broadcast, type, and a video object with videoUrl, caption, mimeType, seconds, and viewOnce. ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": false, "momment": 1632228889000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "video": { "videoUrl": "https://", "caption": "", "mimeType": "video/mp4", "seconds": 13, "viewOnce": true }, "instanceId": "instance.id" } ``` -------------------------------- ### Carousel Return Example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example payload for a carousel message received via the On Message Received webhook. ```APIDOC ## Carousel Return Example ### Description Example payload for a carousel message received via the On Message Received webhook. ### Payload ```json { "isStatusReply": false, "chatLid": null, "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": false, "isNewsletter": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "554499999999", "fromMe": true, "momment": 1739368022130, "status": "SENT", "chatName": "Nome", "senderPhoto": null, "senderName": "Nome", "photo": "https://", "broadcast": false, "participantLid": null, "forwarded": false, "type": "ReceivedCallback", "fromApi": true, "carouselMessage": { "text": "Message text", "cards": [ { "header": { "image": { "imageUrl": "https://", "thumbnailUrl": "https://", "caption": "", "mimeType": "image/jpeg", "viewOnce": false, "width": 0, "height": 0 } }, "message": "Carousel card message", "footer": "", "title": "", "hydratedButtons": [ { "index": 0, "urlButton": { "displayText": "Button text", "url": "https://" } }, { "index": 1, "quickReplyButton": { "displayText": "Button text", "id": "2" } } ] }, { "header": { "image": { "imageUrl": "https://", "thumbnailUrl": "https://", "caption": "", "mimeType": "image/jpeg", "viewOnce": false, "width": 0, "height": 0 } }, "message": "Carousel card message", "footer": "", "title": "", "hydratedButtons": [ { "index": 0, "urlButton": { "displayText": "Button text", "url": "https://" } }, { "index": 1, "quickReplyButton": { "displayText": "Button text", "id": "2" } } ] } ] } } ``` ``` -------------------------------- ### Button with Video Return Example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a message with buttons and a video. The buttonsMessage object includes a videoUrl, message text, and a buttons array with buttonId, type, and displayText. ```json { "isStatusReply": false, "chatLid": "81896604192873@lid", "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": false, "isNewsletter": false, "instanceId": "3C67AB641C8AA0412F6A2242B4E23AC7", "messageId": "9D968A5FA2880508C4", "phone": "554499999999", "fromMe": false, "momment": 1708455444850, "status": "RECEIVED", "chatName": "name", "senderPhoto": null, "senderName": "554499999999", "photo": null, "broadcast": false, "participantLid": null, "forwarded": false, "type": "ReceivedCallback", "fromApi": false, "buttonsMessage": { "imageUrl": null, "videoUrl": "Video URL", "message": "Message text", "buttons": [ { "buttonId": "1", "type": 1, "buttonText": { "displayText": "Button text 1" } }, { "buttonId": "2", "type": 1, "buttonText": { "displayText": "Button text 2" } } ] } } ``` -------------------------------- ### Contact feedback example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a received contact message. Contains a contact object with displayName, vCard, and phones array. ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": false, "momment": 1632228925000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "contact": { "displayName": "Cesar Baleco", "vCard": "BEGIN:VCARD\nVERSION:3.0\nN:;nome;;;\nFN:nome\nTEL;type=CELL;type=VOICE;waid=5544999999999:+55 44 9999-9999\nEND:VCARD", "phones": ["5544999999999"] }, "instanceId": "instance.id" } ``` -------------------------------- ### Sticker Feedback Example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example payload for a sticker feedback event received via the On Message Received webhook. ```APIDOC ## Sticker Feedback Example ### Description Example payload for a sticker feedback event received via the On Message Received webhook. ### Payload ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": false, "momment": 1632228982000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "sticker": { "stickerUrl": "https://", "mimeType": "image/webp" }, "instanceId": "instance.id" } ``` ``` -------------------------------- ### Document return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a received document message. Contains a document object with documentUrl, mimeType, title, pageCount, and fileName. ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": false, "momment": 1632228955000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "document": { "documentUrl": "https://", "mimeType": "application/pdf", "title": "nome", "pageCount": 1, "fileName": "nome.pdf" }, "instanceId": "instance.id" } ``` -------------------------------- ### Template localization return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example payload for a template localization return, including hydrated template data with header location, message, footer, title, and template ID. ```json { "isStatusReply": false, "chatLid": "199016268742711@lid", "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": false, "isNewsletter": false, "instanceId": "3C67AB641C8AA0412F6A2242B4E23AC7", "messageId": "27BBF23E0185D363D9", "phone": "554499999999", "fromMe": false, "momment": 1708456969808, "status": "RECEIVED", "chatName": "name", "senderPhoto": null, "senderName": "554499999999", "photo": null, "broadcast": false, "participantLid": null, "forwarded": false, "type": "ReceivedCallback", "fromApi": false, "hydratedTemplate": { "header": { "location": { "longitude": -46.6388, "latitude": -23.5489, "name": "somewhere", "address": "somewhere", "url": "" } }, "message": "message text", "footer": "message footer", "title": "message title", "templateId": "1143940003434066", "hydratedButtons": [] } } ``` -------------------------------- ### Sticker feedback example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a received sticker message. Contains sticker object with stickerUrl and mimeType. ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": false, "momment": 1632228982000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "sticker": { "stickerUrl": "https://", "mimeType": "image/webp" }, "instanceId": "instance.id" } ``` -------------------------------- ### Example of Return of Payment Made Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example payload for a payment made event received via the On Message Received webhook. ```APIDOC ## Example of Return of Payment Made ### Description Example payload for a payment made event received via the On Message Received webhook. ### Payload ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": false, "momment": 1632229683000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "requestPayment": { "value": 1, "currencyCode": "BRL", "expiration": 1632834482000, "requestPhone": "5544999999999", "paymentInfo": { "receiverPhone": "5544999999999", "value": 1, "currencyCode": "BRL", "status": "WAITING", "transactionStatus": "COLLECT_SUCCESS" } }, "instanceId": "instance.id" } ``` ``` -------------------------------- ### Localization feedback example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example payload for localization feedback, including location coordinates and address fields. Note the 'instanceId' field appears twice in the JSON. ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": false, "momment": 1632228970000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "location": { "longitude": -99.999999999999999, "latitude": -99.9999999999999999, "address": "", "url": "" }, "instanceId": "instance.id" } ``` -------------------------------- ### Pin message return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a pin message callback. Contains the 'pinMessage' object with action, duration, and referenced message details. ```json { "isStatusReply": false, "senderLid": "81896604192873@lid", "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": false, "isNewsletter": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": true, "momment": 1632228955000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "pinMessage": { "action": "pin", "pinDurationInSecs": 604800, "referencedMessage": { "messageId": "3EB0796DC6B777C0C7CD", "fromMe": true, "phone": "554499999999", "participant": null } } } ``` -------------------------------- ### Example of return of payment made Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a payment made callback. Contains requestPayment object with value, currencyCode, expiration, requestPhone, and paymentInfo with status and transactionStatus. ```json { "waitingMessage": false, "isGroup": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "5544999999999", "fromMe": false, "momment": 1632229683000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "requestPayment": { "value": 1, "currencyCode": "BRL", "expiration": 1632834482000, "requestPhone": "5544999999999", "paymentInfo": { "receiverPhone": "5544999999999", "value": 1, "currencyCode": "BRL", "status": "WAITING", "transactionStatus": "COLLECT_SUCCESS" } }, "instanceId": "instance.id" } ``` -------------------------------- ### Notification response examples for various WhatsApp notification types Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md A series of JavaScript-like case blocks for handling different notification types, each building an HTML alert message. These examples are from the 'Examples' section and cover GROUP_PARTICIPANT_LEAVE, E2E_ENCRYPTED, GROUP_CREATE, GROUP_PARTICIPANT_ADD, CALL_MISSED_VOICE, CALL_MISSED_VIDEO, GROUP_PARTICIPANT_REMOVE, CIPHERTEXT, BLUE_MSG_SELF_PREMISE_UNVERIFIED, BLUE_MSG_SELF_PREMISE_VERIFIED, BIZ_MOVE_TO_CONSUMER_APP, and REVOKE. ```javascript case 'GROUP_PARTICIPANT_LEAVE': campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Participante " + valor2.notificationparameters + " saiu do grupo!<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case 'E2E_ENCRYPTED': // code block campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>As mensagens são protegidas com a criptografia<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case 'GROUP_CREATE': campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Criou o grupo \'" + valor2.notificationparameters + "\'<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case 'GROUP_PARTICIPANT_ADD': campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Participante " + valor2.notificationparameters + " adicionado.<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case "CALL_MISSED_VOICE": campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Chamada de voz perdida!<br><br></span>" + campohora + "</div></div>" break ``` ```javascript case "CALL_MISSED_VIDEO": campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Chamada de vídeo perdida!<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case 'GROUP_PARTICIPANT_REMOVE': campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Participante " + valor2.notificationparameters + " foi removido.<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case "CIPHERTEXT": campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>As mensagens são protegidas com a criptografia de ponta.<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case "BLUE_MSG_SELF_PREMISE_UNVERIFIED": campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Você está conversando com uma conta comercial, mas ainda não foi confirmada pelo WhatsApp.<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case "BLUE_MSG_SELF_PREMISE_VERIFIED": campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Você está conversando com uma conta comercial verificada pelo WhatsApp.<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case "BIZ_MOVE_TO_CONSUMER_APP": campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Esta conta comercial agora está registrada como uma conta pessoal e pode não mais pertencer a uma empresa.<br><br></span>" + campohora + "</div></div>" break; ``` ```javascript case "REVOKE": campo_html = "<div align='center'><div class='alert alert-primary' role='alert'><span>Apagou uma mensagem.<br><br></span>" + campohora + "</div></div>" break; ``` -------------------------------- ### Template video return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a received template video message. Includes hydratedTemplate object with header containing video details, message, footer, title, templateId, and hydratedButtons. ```json { "isStatusReply": false, "chatLid": "81896604192873@lid", "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": false, "isNewsletter": false, "instanceId": "3C67AB641C8AA0412F6A2242B4E23AC7", "messageId": "0E4AD761B62E3D5EF9", "phone": "5544999999999", "fromMe": false, "momment": 1708456287181, "status": "RECEIVED", "chatName": "name", "senderPhoto": null, "senderName": "5544999999999", "photo": null, "broadcast": false, "participantLid": null, "forwarded": false, "type": "ReceivedCallback", "fromApi": false, "hydratedTemplate": { "header": { "video": { "videoUrl": "https://example.mp4", "caption": "", "mimeType": "video/mp4", "width": 0, "height": 0, "seconds": 0, "viewOnce": false } }, "message": "message text", "footer": "message footer", "title": "message title", "templateId": "938481574354947", "hydratedButtons": [] } } ``` -------------------------------- ### Button with Image Return Example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a message with buttons and an image. The buttonsMessage object includes an imageUrl, message text, and a buttons array with buttonId, type, and displayText. ```json { "isStatusReply": false, "chatLid": "81896604192873@lid", "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": false, "isNewsletter": false, "instanceId": "3C67AB641C8AA0412F6A2242B4E23AC7", "messageId": "9D968A5FA2880508C4", "phone": "554499999999", "fromMe": false, "momment": 1708455444850, "status": "RECEIVED", "chatName": "name", "senderPhoto": null, "senderName": "554499999999", "photo": null, "broadcast": false, "participantLid": null, "forwarded": false, "type": "ReceivedCallback", "fromApi": false, "buttonsMessage": { "imageUrl": "Image URL", "videoUrl": null, "message": "Message text", "buttons": [ { "buttonId": "1", "type": 1, "buttonText": { "displayText": "Button text 1" } }, { "buttonId": "2", "type": 1, "buttonText": { "displayText": "Button text 2" } } ] } } ``` -------------------------------- ### Event response return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for an event response callback. Contains the 'eventResponse' object with response status, responder, timestamp, and referenced message. ```json { "isStatusReply": false, "senderLid": "81896604192873@lid", "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": true, "isNewsletter": false, "instanceId": "A20DA9C0183A2D35A260F53F5D2B9244", "messageId": "A20DA9C0183A2D35A260F53F5D2B9244", "phone": "120363019502650977-group", "fromMe": false, "momment": 1632228638000, "status": "RECEIVED", "chatName": "name", "senderPhoto": "https://", "senderName": "name", "participantPhone": null, "participantLid": null, "photo": "https://", "broadcast": false, "type": "ReceivedCallback", "eventResponse": { "response": "GOING", "responseFrom": "554499999999", "time": 1714423417000, "referencedMessage": { "messageId": "D2D612289D9E8F62307D72409A8D9DC3", "fromMe": false, "phone": "120363239161320697-group", "participant": "554499999988" } } } ``` -------------------------------- ### Template document return example Source: https://github.com/z-api/z-api-docs/blob/main/i18n/en/docusaurus-plugin-content-docs/current/webhooks/on-message-received.md Example JSON payload for a received template document message. Includes hydratedTemplate object with header containing document details, message, footer, title, templateId, and hydratedButtons. ```json { "isStatusReply": false, "chatLid": "81896604192873@lid", "connectedPhone": "554499999999", "waitingMessage": false, "isEdit": false, "isGroup": false, "isNewsletter": false, "instanceId": "3C67AB641C8AA0412F6A2242B4E23AC7", "messageId": "9D968A5FA2880508C4", "phone": "554499999999", "fromMe": false, "momment": 1708455444850, "status": "RECEIVED", "chatName": "name", "senderPhoto": null, "senderName": "554499999999", "photo": null, "broadcast": false, "participantLid": null, "forwarded": false, "type": "ReceivedCallback", "fromApi": false, "hydratedTemplate": { "header": { "document": { "caption": null, "documentUrl": "https://example.pdf", "mimeType": "application/pdf", "title": "", "pageCount": 0, "fileName": "" } }, "message": "message text", "footer": "message footer", "title": "message title", "templateId": "811492407484976", "hydratedButtons": [] } } ```