Upon receiving
#
ConceptThis is the incoming message return webhook
Attention
Z-API does not accept webhooks that aren’t HTTPS
#
Updating the webhookTo update the webhook route, you can do it through the API or through the admin panel.
#
API#
/update-webhook-receivedPUT
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/update-webhook-received
#
OrYou can also update the route with the "sent by me" option enabled.
#
/update-webhook-received-deliveryPUT
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/update-webhook-received-delivery
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
Request Body#
Administrative panel#
Returns from webhooksThe possible returns of the on-message-received webhook are registered below:
#
ResponseAttributos | Type | Description |
---|---|---|
waitingMessage | boolean | Identifies if your message is in "Waiting for message" status |
phone | string | Phone number, or number of the group that sent the message. |
participantPhone | string | Phone number of the group member who sent the message. |
messageId | string | Message identifier in the conversation. |
status | string | Status the message is in at the time of sending (PENDING, SENT, RECEIVED, READ or PLAYED). |
referenceMessageId | string | Reference the message that was replied to in case the message received is a reply to a message in the conversation. |
momment | integer | Time when the message was received or from the error. |
type | string | Instance event type, in this case it will be "ReceivedCallBack". |
photo | string | Photo url of the user who sent the message. |
text.message | string | Message text. |
image.caption | string | Photo’s caption |
image.imageUrl | string | Photo’s URL |
image.thumbnailUrl | string | Photo’s URL thumbnail |
image.mimeType | string | Image’s Mime Type |
audio.mimeType | string | Audio’s MimeType |
audio.audioUrl | string | Audio’s URL |
video.caption | string | Video’s caption |
video.videoUrl | string | Video’s URL |
video.mimeType | string | Video’s MimeType |
contact.displayName | string | Contact’s name |
contact.vCard | string | VCard containing the contact information. |
document.mimeType | string | Document’s MimeType |
document.fileName | string | Document’s name |
document.title | string | Document’s Title |
document.pageCount | string | Number of pages in the document |
document.thumbnailUrl | string | URL of the document's thumbnail. |
document.documentUrl | string | Document’s URL |
location.thumbnailUrl | string | Location thumbnail url. |
location.longitude | float | Location’s longitude |
location.latitude | float | Location's latitude |
location.url | string | Localization’s URL |
location.name | string | Localization’s name |
location.address | string | Localizations’s address |
sticker.mimeType | string | Sticker’s MimeType |
sticker.stickerUrl | string | Stickers URL |
#
200#
Text return example#
Reaction return example#
Example return text (Button List)#
Example return text (Picklist)#
Photo return example#
Audio feedback example#
Video feedback example#
Contact feedback example#
Document feedback example#
Localization’s feedback example#
Sticker feedback example#
Example of return of payment made#
Payment request return example#
Example of payment receipt return#
Product return example#
Cart return example#
Example of Poll Response#
Example of Poll Response Message#
Send order return example#
Update order return example#
405In 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.
#
415In 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#
ConceptNotifications 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.