Skip to main content

Upon receiving

Concept#

This is the incoming message return webhook

Attention

Z-API does not accept webhooks that aren’t HTTPS


Updating the webhook#

To update the webhook route, you can do it through the API or through the admin panel.

API#

/update-webhook-received#

PUT https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/update-webhook-received

Or#

You can also update the route with the "sent by me" option enabled.

/update-webhook-received-delivery#

PUT https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/update-webhook-received-delivery

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Request Body#

{
"value": "https://endereco-do-seu-sistema.com.br/instancia/SUA_INSTANCIA/receive"
}

Administrative panel#

img


Returns from webhooks#

The possible returns of the on-message-received webhook are registered below:

Response#

AttributosTypeDescription
waitingMessagebooleanIdentifies if your message is in "Waiting for message" status
phonestringPhone number, or number of the group that sent the message.
participantPhonestringPhone number of the group member who sent the message.
messageIdstringMessage identifier in the conversation.
statusstringStatus the message is in at the time of sending (PENDING, SENT, RECEIVED, READ or PLAYED).
referenceMessageIdstringReference the message that was replied to in case the message received is a reply to a message in the conversation.
mommentintegerTime when the message was received or from the error.
typestringInstance event type, in this case it will be "ReceivedCallBack".
photostringPhoto url of the user who sent the message.
text.messagestringMessage text.
image.captionstringPhoto’s caption
image.imageUrlstringPhoto’s URL
image.thumbnailUrlstringPhoto’s URL thumbnail
image.mimeTypestringImage’s Mime Type
audio.mimeTypestringAudio’s MimeType
audio.audioUrlstringAudio’s URL
video.captionstringVideo’s caption
video.videoUrlstringVideo’s URL
video.mimeTypestringVideo’s MimeType
contact.displayNamestringContact’s name
contact.vCardstringVCard containing the contact information.
document.mimeTypestringDocument’s MimeType
document.fileNamestringDocument’s name
document.titlestringDocument’s Title
document.pageCountstringNumber of pages in the document
document.thumbnailUrlstringURL of the document's thumbnail.
document.documentUrlstringDocument’s URL
location.thumbnailUrlstringLocation thumbnail url.
location.longitudefloatLocation’s longitude
location.latitudefloatLocation's latitude
location.urlstringLocalization’s URL
location.namestringLocalization’s name
location.addressstringLocalizations’s address
sticker.mimeTypestringSticker’s MimeType
sticker.stickerUrlstringStickers URL

200#

Text return example#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"momment": 1632228638000,
"status": "RECEIVED",
"chatName": "name",
"senderPhoto": "https://",
"senderName": "name",
"participantPhone": null,
"participantLid": null,
"photo": "https://",
"broadcast": false,
"type": "ReceivedCallback",
"text": {
"message": "test"
},
}

Template text return example#

{
"isStatusReply": false,
"chatLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"isNewsletter": false,
"instanceId": "3C67AB641C8AA0412F6A2242B4E23AC7",
"messageId": "702CC5F7E0A6BF4421",
"phone": "5544999999999",
"fromMe": false,
"momment": 1708457193876,
"status": "RECEIVED",
"chatName": "Test Number",
"senderPhoto": null,
"senderName": "5544999999999",
"photo": null,
"broadcast": false,
"participantLid": null,
"forwarded": false,
"type": "ReceivedCallback",
"fromApi": false,
"hydratedTemplate": {
"header": {},
"message": "message text",
"footer": "message footer",
"title": "message title",
"templateId": "790118069824606",
"hydratedButtons": []
}
}

Reaction return example#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": 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",
"reaction": {
"value": "❤️",
"time": 1651878681150,
"reactionBy": "554499999999",
"referencedMessage": {
"messageId": "3EB0796DC6B777C0C7CD",
"fromMe": true,
"phone": "5544999999999",
"participant": null
}
},
}

Example return text (Button List)#

{
"waitingMessage": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"momment": 1634645380000,
"status": "RECEIVED",
"chatName": "Nome",
"senderPhoto": "https://",
"senderName": "Nome",
"participantPhone": null,
"participantLid": null,
"photo": "https://",
"broadcast": false,
"referenceMessageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"forwarded": false,
"type": "ReceivedCallback",
"buttonsResponseMessage": {
"buttonId": "1",
"message": "Ă“timo"
},
"instanceId": "instance.id"
}

Example return text (Picklist)#

{
"waitingMessage": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"momment": 1634645683000,
"status": "RECEIVED",
"chatName": "Nome",
"senderPhoto": "https://",
"senderName": "Nome",
"participantPhone": null,
"participantLid": null,
"photo": "https://",
"broadcast": false,
"referenceMessageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"forwarded": false,
"type": "ReceivedCallback",
"listResponseMessage": {
"message": "Z-API Wings for your imagination",
"title": "Z-API",
"selectedRowId": "1"
},
"instanceId": "instance.id"
}

Image return example#

{
"waitingMessage": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"momment": 1632228828000,
"status": "RECEIVED",
"chatName": "name",
"senderPhoto": "https://",
"senderName": "name",
"participantPhone": null,
"participantLid": null,
"photo": "https://",
"broadcast": false,
"type": "ReceivedCallback",
"image": {
"mimeType": "image/jpeg",
"imageUrl": "https://",
"thumbnailUrl": "https://",
"caption": "",
"thumbnailUrl": "https://",
"width": 600,
"height": 315,
"viewOnce": true
},
"instanceId": "instance.id"
}

Template image return example#

{
"isStatusReply": false,
"chatLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"isNewsletter": false,
"instanceId": "3C67AB641C8AA0412F6A2242B4E23AC7",
"messageId": "885FF934BF100D579E",
"phone": "554499999999",
"fromMe": false,
"momment": 1708454725028,
"status": "RECEIVED",
"chatName": "name",
"senderPhoto": null,
"senderName": "554499999999",
"photo": null,
"broadcast": false,
"participantLid": null,
"forwarded": false,
"type": "ReceivedCallback",
"fromApi": false,
"hydratedTemplate": {
"header": {
"image": {
"imageUrl": "https://example.jpeg",
"thumbnailUrl": "https://example.jpeg",
"caption": "",
"mimeType": "image/jpeg",
"viewOnce": false,
"width": 1600,
"height": 926
}
},
"message": "message text",
"footer": "message footer",
"title": "message title",
"templateId": "674504507982622",
"hydratedButtons": []
}
}

Audio feedback example#

{
"waitingMessage": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"momment": 1632228849000,
"status": "RECEIVED",
"chatName": "name",
"senderPhoto": "https://",
"senderName": "name",
"participantPhone": null,
"participantLid": null,
"photo": "https://",
"broadcast": false,
"type": "ReceivedCallback",
"audio": {
"ptt": true,
"seconds": 10,
"audioUrl": "https://",
"mimeType": "audio/ogg; codecs=opus",
"viewOnce": true
},
"instanceId": "instance.id"
}

Video return example#

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

Template video return example#

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

Contact feedback example#

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

Document return example#

{
"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 document return example#

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

Localization’s feedback example#

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

Template localization return example#

{
"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#

{
"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#

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

Payment request return example#

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

Example of an admin promoted to newsletter#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"isNewsletter": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "464201093",
"phone": "5544999999999@newsletter",
"fromMe": false,
"momment": 1682017970000,
"status": "RECEIVED",
"chatName": "newsletter name",
"senderPhoto": null,
"senderName": "",
"photo": null,
"broadcast": false,
"participantPhone": "5544999999999",
"referenceMessageId": null,
"externalAdReply": null,
"forwarded": false,
"type": "ReceivedCallback",
"notification": "NEWSLETTER_ADMIN_PROMOTE",
"notificationParameters": [
"5544999999999",
"ADMIN"
],
"callId": null
}

Example of an admin demoted of newsletter#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"isNewsletter": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "464201093",
"phone": "5544999999999@newsletter",
"fromMe": false,
"momment": 1682017970000,
"status": "RECEIVED",
"chatName": "newsletter name",
"senderPhoto": null,
"senderName": "",
"photo": null,
"broadcast": false,
"participantPhone": "5544999999999",
"referenceMessageId": null,
"externalAdReply": null,
"forwarded": false,
"type": "ReceivedCallback",
"notification": "NEWSLETTER_ADMIN_DEMOTE",
"notificationParameters": [
"5544999999999",
"SUBSCRIBER"
],
"callId": null
}

Example of payment receipt return#

{
"waitingMessage": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"momment": 1632230512000,
"status": "RECEIVED",
"chatName": "name",
"senderPhoto": "https://",
"senderName": "name",
"participantPhone": null,
"participantLid": null,
"photo": "https://",
"broadcast": false,
"type": "ReceivedCallback",
"sendPayment": {
"paymentInfo": {
"receiverPhone": "5544999999999",
"value": 1,
"currencyCode": "BRL",
"status": "COMPLETE",
"transactionStatus": "SUCCESS"
}
},
"instanceId": "instance.id"
}

Product return example#

{
"waitingMessage": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"momment": 1632233527000,
"status": "RECEIVED",
"senderPhoto": "https://",
"senderName": "5544999999999",
"participantPhone": null,
"participantLid": null,
"photo": "https://",
"broadcast": false,
"type": "ReceivedCallback",
"product": {
"productImage": "https://",
"businessOwnerJid": "5544999999999",
"currencyCode": "BRL",
"productId": "99999999999999999999",
"description": "",
"productImageCount": 1,
"price": 1,
"url": "",
"retailerId": "",
"firstImageId": "",
"title": "name"
},
"instanceId": "instance.id"
}

Cart return example#

{
"waitingMessage": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"momment": 1632233527000,
"status": "RECEIVED",
"chatName": "name",
"senderPhoto": null,
"senderName": "name",
"photo": "https://",
"broadcast": false,
"forwarded": false,
"type": "ReceivedCallback",
"order": {
"itemCount": 1,
"orderId": "422508169684569",
"message": "",
"orderTitle": "name",
"sellerJid": "5544999999999",
"thumbnailUrl": "https://",
"token": "AR5d4yUr+DmSzeCR2kUtPEeMfS+eG0O+S/T/17B+oY1mfA==",
"currency": "BRL",
"total": 2000,
"subTotal": 2000,
"products": [
{
"quantity": 1,
"name": "nameProduct",
"productId": "5338924696127051",
"retailerId": "1242",
"price": 2000,
"currencyCode": "BRL"
}
]
}
}

Example of Poll Response#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"moment": 1632228638000,
"status": "RECEIVED",
"chatName": "name",
"senderPhoto": "https://",
"senderName": "name",
"participantPhone": null,
"participantLid": null,
"photo": "https://",
"broadcast": false,
"type": "ReceivedCallback",
"poll": {
"question": "What is the best WhatsApp API?",
"options": [
{
"name": "Z-API"
},
{
"name": "Others"
}
]
},
}

Example of Poll Response Message#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"instanceId": "A20DA9C0183A2D35A260F53F5D2B9244",
"messageId": "A20DA9C0183A2D35A260F53F5D2B9244",
"phone": "5544999999999",
"fromMe": false,
"moment": 1632228638000,
"status": "RECEIVED",
"chatName": "name",
"senderPhoto": "https://",
"senderName": "name",
"participantPhone": "If it's a group, this will be the participant who responded",
"photo": "https://",
"broadcast": false,
"type": "ReceivedCallback",
"pollVote": {
"pollMessageId": "ID of the poll message that was responded to",
"options": [
{
"name": "Z-API"
}
]
},
}

Send order return example#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"isNewsletter": 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",
"reviewAndPay": {
"type": "physical-goods",
"currency": "BRL",
"referenceId": "4N9AVI38VOB",
"orderRequestId": "4N9AVI38VYZ",
"orderStatus": "pending",
"paymentStatus": "pending",
"total": 605,
"subTotal": 600,
"discount": 10,
"shipping": 5,
"tax": 10,
"products": [
{
"name": "order 1",
"quantity": 2,
"isCustomItem": true,
"productId": "custom-item-4N9AVI38WI1",
"value": 150
},
{
"name": "order 2",
"quantity": 2,
"isCustomItem": false,
"productId": "23940797548900636",
"value": 150
}
]
}
}

Update order return example#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"isNewsletter": 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",
"reviewOrder": {
"currency": "BRL",
"referenceId": "4N9AVI38VOB",
"orderRequestId": "4N9AVI38VYZ",
"orderStatus": "processing",
"paymentStatus": "pending",
"total": 605,
"subTotal": 600,
"discount": 10,
"shipping": 5,
"tax": 10,
"products": [
{
"name": "order 1",
"quantity": 2,
"isCustomItem": true,
"productId": "custom-item-4N9AVI38WI1",
"value": 150
},
{
"name": "order 2",
"quantity": 2,
"isCustomItem": false,
"productId": "23940797548900636",
"value": 150
}
]
}
}

Newsletter admin invitation return example#

{
"isStatusReply": false,
"senderLid": "81896604192873@lid",
"connectedPhone": "554499999999",
"waitingMessage": false,
"isEdit": false,
"isGroup": false,
"isNewsletter": 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",
"newsletterAdminInvite": {
"newsletterId": "120363166555745933@newsletter",
"newsletterName": "Teste",
"text": "I want to invite you to be an admin of my channel on WhatsApp.",
"inviteExpiration": 1706809668
}
}

Pin message return example#

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

405#

In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or PUT as specified at the beginning of this topic.

415#

In case you receive 415 error, make sure to add the “Content-Type” of the object you are sending in the request headers, mostly “application/json”


Notification Response#

Concept#

Notifications are WhatsApp messages that are based on WhatsApp preview message templates.

This way, the notifications we receive are documented here, if you do not want to receive these notifications, you must ignore the message when it arrives with the notification attribute.

Examples#

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;
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;
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;
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;
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
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;
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;
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;
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;
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;
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;
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;