Skip to content

Whatsapp Reaction Messages

Reaction messages are emoji-reactions that you can apply to a previous WhatsApp user message that you have received.

Note: Cannot react to a reaction message

Image Alt Text

Reaction Object

Parameter Type Description Value / Pattern
*message_id String The WhatsApp Message ID (wamid) of the message on which the reaction should appear. The reaction will not be sent if the message is, older than 30 days, a reaction message or has been deleted. Also, if the ID is of a message that has been deleted, the message will not be delivered. 6847c2ea-b52f-11ee-8fa2-0242ac190007
*emoji String Emoji to appear on the message. Unicode escape sequence of the emoji, or the emoji itself. \uD83D\uDE00 or 😀
"reaction": {
            "message_id": "6847c2ea-b52f-11ee-8fa2-0242ac190007",
            "emoji": "\uD83D\uDE00"
            }

Programing Examples:

 curl --location 'https://apialpha.d7networks.com/whatsapp/v2/send' \
 --header 'Content-Type: application/json' \
 --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc' \
 --data '{
     "messages": [
         {
             "originator": "{registered phone_number}",
             "content": {
                 "message_type": "REACTION",
                 "reaction": {
                     "message_id": "6847c2ea-b52f-11ee-8fa2-0242ac190007",
                     "emoji": "\uD83D\uDE00"
                 }
             },
             "recipients": [
                 {
                     "recipient": "{recipient}",
                     "recipient_type": "individual"
                 }
             ],
             "report_url": "https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f"
         }
     ]
 }'
  npm i direct7
  const Client = require('direct7')

  const client = new Client(apiToken="Your API token")

  const response = await client.whatsapp.sendWhatsAppFreeformMessage({
      originator: "{registered_phonenumber}",
      recipient: "{recipient}",
      message_type: "REACTION",
      message_id: "9f87d93e-1696-11ef-a5a3-0242ac1b002c",
      emoji: "\uD83D\uDE00"
  });
  console.log(response);
pip install direct7
1
2
3
4
5
6
7
8
from direct7 import Client

client = Client(api_token="Your API token")
client.whatsapp.send_whatsapp_freeform_message(originator="{registered_phonenumber}",
                                                recipient="{recipient}",
                                                message_type="REACTION",
                                                message_id="f1a99798-11aa-11ef-9821-0242ac1b0030",
                                                emoji="\U0001F600")

composer require direct7/direct7-php
require_once 'vendor/autoload.php';
1
2
3
4
5
6
7
8
require_once __DIR__ . '/vendor/autoload.php';

use direct7\Direct7\Client;

$client = new Client(api_token="Your API token")

$response = $direct7->whatsapp->sendWhatsAppFreeformMessage(originator:"{registered_phonenumber}", recipient:"{recipient}", message_type:"REACTION", message_id: "966c7b62-172b-11ef-a5a3-0242ac1b002c", emoji: "😀");
var_dump($response);
go get -u github.com/d7networks/direct7-go-sdk
import (
"github.com/d7networks/direct7-go-sdk/direct7"
)
apiToken := "Your Api Token"
client := direct7.NewClient(apiToken)
originator := "{registered_phonenumber}"
recipient := "{recipient}"
messageType := "REACTION"
optParams := &OptionalParams{
  messageId: "8916e1ac-26e2-11ef-acba-0242ac1b002e", 
  emoji: "\U0001F600"
  }
response, err := whatsapp.SendWhatsAppFreeformMessage(originator, recipient, messageType, optParams)
 OkHttpClient client = new OkHttpClient().newBuilder().build();
 MediaType mediaType = MediaType.parse("application/json");
 RequestBody body = RequestBody.create(mediaType, "{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"REACTION\",\n                \"reaction\": {\n                    \"message_id\": \"6847c2ea-b52f-11ee-8fa2-0242ac190007\",\n                    \"emoji\": \"\\uD83D\\uDE00\"\n                }\n            },\n            \"recipients\": [\n                {\n                    \"recipient\": \"{recipient}\",\n                    \"recipient_type\": \"individual\"\n                }\n            ],\n            \"report_url\": \"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f\"\n        }\n    ]\n}");
 Request request = new Request.Builder()
   .url("https://apialpha.d7networks.com/whatsapp/v2/send")
   .method("POST", body)
   .addHeader("Content-Type", "application/json")
   .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc")
   .build();
 Response response = client.newCall(request).execute();
 var headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc'
 };
 var request = http.Request('POST', Uri.parse('https://apialpha.d7networks.com/whatsapp/v2/send'));
 request.body = json.encode({
   "messages": [
     {
       "originator": "{registered phone_number}",
       "content": {
         "message_type": "REACTION",
         "reaction": {
           "message_id": "6847c2ea-b52f-11ee-8fa2-0242ac190007",
           "emoji": "😀"
         }
       },
       "recipients": [
         {
           "recipient": "{recipient}",
           "recipient_type": "individual"
         }
       ],
       "report_url": "https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f"
     }
   ]
 });
 request.headers.addAll(headers);

 http.StreamedResponse response = await request.send();

 if (response.statusCode == 200) {
   print(await response.stream.bytesToString());
 }
 else {
   print(response.reasonPhrase);
 }
 $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
 $headers.Add("Content-Type", "application/json")
 $headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc")

 $body = @"
 {
     `"messages`": [
         {
             `"originator`": `"{registered phone_number}`",
             `"content`": {
                 `"message_type`": `"REACTION`",
                 `"reaction`": {
                     `"message_id`": `"6847c2ea-b52f-11ee-8fa2-0242ac190007`",
                     `"emoji`": `"`\uD83D`\uDE00`"
                 }
             },
             `"recipients`": [
                 {
                     `"recipient`": `"{recipient}`",
                     `"recipient_type`": `"individual`"
                 }
             ],
             `"report_url`": `"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f`"
         }
     ]
 }
 "@

 $response = Invoke-RestMethod 'https://apialpha.d7networks.com/whatsapp/v2/send' -Method 'POST' -Headers $headers -Body $body
 $response | ConvertTo-Json
gem install direct7
require 'direct7'

client = Direct7::Client.new('Your API token')

client.whatsapp.send_whatsapp_freeform_message(
    originator='{originator}',
    recipient='{recipient}',
    message_type='REACTION',
    body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil, type=nil, url=nil, caption=nil, filename=nil,
    message_id="3e382940-1cd6-11ef-883c-0242ac1b002c",
    emoji= "😀"
)
1
2
3
4
5
6
7
8
  var client = new HttpClient();
  var request = new HttpRequestMessage(HttpMethod.Post, "https://apialpha.d7networks.com/whatsapp/v2/send");
  request.Headers.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoLWJhY2tlbmQ6YXBwIiwic3ViIjoiZjM0N2JhMDktMTllMi00MmIxLWE3ZjYtZDIyOGNlOTczN2U2In0.-ECRlIIiXGoF01JJEf7lmZjHCzny0vAKSlTFGbHQuwc");
  var content = new StringContent("{\n    \"messages\": [\n        {\n            \"originator\": \"{registered phone_number}\",\n            \"content\": {\n                \"message_type\": \"REACTION\",\n                \"reaction\": {\n                    \"message_id\": \"6847c2ea-b52f-11ee-8fa2-0242ac190007\",\n                    \"emoji\": \"\\uD83D\\uDE00\"\n                }\n            },\n            \"recipients\": [\n                {\n                    \"recipient\": \"{recipient}\",\n                    \"recipient_type\": \"individual\"\n                }\n            ],\n            \"report_url\": \"https://webhook.site/4235f691-13ab-448e-b100-74a3a627927f\"\n        }\n    ]\n}", null, "application/json");
  request.Content = content;
  var response = await client.SendAsync(request);
  response.EnsureSuccessStatusCode();
  Console.WriteLine(await response.Content.ReadAsStringAsync());