API Reference
Send reaction to message
Send an emoji reaction to an existing WhatsApp message. Reactions are only supported for WhatsApp messages.
POST
/
v1
/
messages
/
{messageId}
/
reactions
Send reaction to message
curl --request POST \
--url https://api.zavu.dev/v1/messages/{messageId}/reactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"emoji": "👍"
}'import requests
url = "https://api.zavu.dev/v1/messages/{messageId}/reactions"
payload = { "emoji": "👍" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({emoji: '👍'})
};
fetch('https://api.zavu.dev/v1/messages/{messageId}/reactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zavu.dev/v1/messages/{messageId}/reactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'emoji' => '👍'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zavu.dev/v1/messages/{messageId}/reactions"
payload := strings.NewReader("{\n \"emoji\": \"👍\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zavu.dev/v1/messages/{messageId}/reactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"emoji\": \"👍\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/messages/{messageId}/reactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"emoji\": \"👍\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "jd7x2k3m4n5p6q7r8s9t0",
"to": "+56912345678",
"createdAt": "2023-11-07T05:31:56Z",
"from": "+13125551212",
"senderId": "sender_12345",
"text": "<string>",
"content": {
"mediaUrl": "https://example.com/image.jpg",
"mediaId": "<string>",
"mimeType": "image/jpeg",
"filename": "invoice.pdf",
"latitude": 123,
"longitude": 123,
"locationName": "<string>",
"locationAddress": "<string>",
"contacts": [
{
"name": "<string>",
"phones": [
"<string>"
]
}
],
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"listButton": "<string>",
"sections": [
{
"title": "<string>",
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
]
}
],
"ctaDisplayText": "See Dates",
"ctaUrl": "https://example.com/schedule",
"ctaHeaderText": "<string>",
"ctaHeaderMediaUrl": "<string>",
"footerText": "Dates subject to change.",
"emoji": "<string>",
"reactToMessageId": "<string>",
"replyToMessageId": "<string>",
"replyToProviderMessageId": "<string>",
"replyToFrom": "<string>",
"replyToText": "<string>",
"replyToMessageType": "<string>",
"templateId": "<string>",
"templateVariables": {
"1": "John",
"2": "ORD-12345"
},
"templateButtonVariables": {
"0": "abc-report-token"
},
"templateHeaderVariables": {
"1": "Jorge y Laura"
}
},
"providerMessageId": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"cost": 123,
"costProvider": 123,
"costTotal": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "bad_request",
"message": "Reactions are only supported for WhatsApp messages"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional sender profile ID. If omitted, the project's default sender will be used.
Example:
"sender_12345"
Path Parameters
Body
application/json
Single emoji character to react with.
Example:
"👍"
Response
Reaction accepted for delivery.
Show child attributes
Show child attributes
⌘I
Send reaction to message
curl --request POST \
--url https://api.zavu.dev/v1/messages/{messageId}/reactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"emoji": "👍"
}'import requests
url = "https://api.zavu.dev/v1/messages/{messageId}/reactions"
payload = { "emoji": "👍" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({emoji: '👍'})
};
fetch('https://api.zavu.dev/v1/messages/{messageId}/reactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zavu.dev/v1/messages/{messageId}/reactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'emoji' => '👍'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zavu.dev/v1/messages/{messageId}/reactions"
payload := strings.NewReader("{\n \"emoji\": \"👍\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.zavu.dev/v1/messages/{messageId}/reactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"emoji\": \"👍\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/messages/{messageId}/reactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"emoji\": \"👍\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "jd7x2k3m4n5p6q7r8s9t0",
"to": "+56912345678",
"createdAt": "2023-11-07T05:31:56Z",
"from": "+13125551212",
"senderId": "sender_12345",
"text": "<string>",
"content": {
"mediaUrl": "https://example.com/image.jpg",
"mediaId": "<string>",
"mimeType": "image/jpeg",
"filename": "invoice.pdf",
"latitude": 123,
"longitude": 123,
"locationName": "<string>",
"locationAddress": "<string>",
"contacts": [
{
"name": "<string>",
"phones": [
"<string>"
]
}
],
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"listButton": "<string>",
"sections": [
{
"title": "<string>",
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
]
}
],
"ctaDisplayText": "See Dates",
"ctaUrl": "https://example.com/schedule",
"ctaHeaderText": "<string>",
"ctaHeaderMediaUrl": "<string>",
"footerText": "Dates subject to change.",
"emoji": "<string>",
"reactToMessageId": "<string>",
"replyToMessageId": "<string>",
"replyToProviderMessageId": "<string>",
"replyToFrom": "<string>",
"replyToText": "<string>",
"replyToMessageType": "<string>",
"templateId": "<string>",
"templateVariables": {
"1": "John",
"2": "ORD-12345"
},
"templateButtonVariables": {
"0": "abc-report-token"
},
"templateHeaderVariables": {
"1": "Jorge y Laura"
}
},
"providerMessageId": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"cost": 123,
"costProvider": 123,
"costTotal": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "bad_request",
"message": "Reactions are only supported for WhatsApp messages"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}