GetAllowedReactions#
The method is intended for getting the list of available reactions in the messenger. To send reactions to a chat, use the SendReaction method.
Request#
To get the list of available reactions, you need to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/getAllowedReactions/{{apiTokenInstance}}
To get the apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
URL request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
chatId | string | No | When the chat identifier is specified, the method will return the set of reactions available for the specified chat. By default it shows all the reactions available in the WhatsApp messenger |
Request body example#
{
"chatId": "120363043968066561@g.us"
}
Response#
Response fields#
| Field | Type | Description |
|---|---|---|
reactions | object | Data object with the reactions |
Fields of the reactions object#
| Field | Type | Description |
|---|---|---|
quick | object | Data object of the category with the quick reactions |
default | object | Data object of the category with the default reactions |
animalsNature | object | Data object of the "Animals and nature" category |
foodDrink | object | Data object of the "Food and drink" category |
activity | object | Data object of the "Activity" category |
travelPlaces | object | Data object of the "Travel" category |
objects | object | Data object of the "Objects" category |
symbols | object | Data object of the "Symbols" category |
flags | object | Data object of the "Flags" category |
custom | object | Data object of the category with the custom reactions |
Fields of the category object#
| Field | Type | Description |
|---|---|---|
reaction | string | Reaction emoji |
unicode | string | Reaction in unicode format |
Response body example#
{
"reactions": {
"quick": [
{
"reaction": "β€",
"unicode": "\\u2764"
},
{
"reaction": "π",
"unicode": "\\uD83D\\uDC4D"
},
{
"reaction": "π",
"unicode": "\\uD83D\\uDC4E"
},
{
"reaction": "π₯",
"unicode": "\\uD83D\\uDD25"
},
{
"reaction": "π₯°",
"unicode": "\\uD83E\\uDD70"
},
{
"reaction": "π",
"unicode": "\\uD83D\\uDC4F"
}
],
"default": [
{
"reaction": "β€",
"unicode": "\\u2764"
},
{
"reaction": "π",
"unicode": "\\uD83D\\uDC4D"
},
{
"reaction": "π",
"unicode": "\\uD83D\\uDC4E"
},
{
"reaction": "π₯",
"unicode": "\\uD83D\\uDD25"
},
{
"reaction": "π€·ββ",
"unicode": "\\uD83E\\uDD37\\u200D\\u2642"
},
{
"reaction": "π€·",
"unicode": "\\uD83E\\uDD37"
},
{
"reaction": "π€·ββ",
"unicode": "\\uD83E\\uDD37\\u200D\\u2640"
},
{
"reaction": "π‘",
"unicode": "\\uD83D\\uDE21"
}
],
"animalsNature": [],
"foodDrink": [],
"activity": [],
"travelPlaces": [],
"objects": [],
"symbols": [],
"flags": [],
"custom": []
}
}
GetAllowedReactions errors#
For the list of errors common to all methods, see the Common errors section
Code examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/getAllowedReactions/{{apiTokenInstance}}"
payload = {
"chatId": "120363043968066561@g.us"
}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getAllowedReactions/{{apiTokenInstance}}'
--header 'Content-Type: application/json' \
--data-raw '{
"chatId": "120363043968066561@g.us"
}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
.append({{apiUrl}})
.append("/waInstance").append({{idInstance}})
.append("/getAllowedReactions/")
.append({{apiTokenInstance}});
var headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
var jsonBody = "{\"chatId\": \"120363043968066561@g.us\"}";
var requestEntity = new HttpEntity<>(jsonBody, headers);
var response = restTemplate.exchange(requestUrl.toString(), HttpMethod.GET, null, String.class);
System.out.println(response);
var requestUrl = new StringBuilder();
requestUrl
.append({{apiUrl}})
.append("/waInstance").append({{idInstance}})
.append("/getAllowedReactions/")
.append({{apiTokenInstance}});
var response = Unirest.post(requestUrl.toString())
.header("Content-Type", "application/json")
.body("{\"chatId\": \"120363043968066561@g.us\"}")
.asString();
System.out.println(response);
Sub GetAllowedReactions()
Dim url As String
Dim http As Object
Dim response As String
' The apiUrl, idInstance and apiTokenInstance values are available in console, double brackets must be removed
url = "{{apiUrl}}/waInstance{{idInstance}}/getAllowedReactions/{{apiTokenInstance}}"
'chatId - personal or group chat identifier whose message history you want to receive, count - number of messages to receive, default value 100
RequestBody = "{""chatId"":""120363043968066561@g.us""}"
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", url, False
http.Send
response = http.responseText
Debug.Print response
' Outputting the answer to the desired cell
Range("A1").Value = response
Set http = Nothing
End Sub