GetWebhooksCount#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method is used to get the number of notifications in the incoming queue.
Each notification is stored in the queue for 24 hours.
The data of the method is updated once every 10 seconds.
The method uses the limits on the number of requests per second.
Request#
To get the number of notifications in the queue, you have to execute a request at:
GET
{{apiUrl}}/waInstance{{idInstance}}/getWebhooksCount/{{apiTokenInstance}}
For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Response#
Response parameters#
An object with the fields:
| Field | Type | Description |
|---|---|---|
count | integer | The number of notifications in the incoming queue |
Response body example#
Successful execution of the method#
{
"count" : 0
}
GetWebhooksCount errors#
For a list of errors common to all methods, refer to the Common errors section
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/getWebhooksCount/{{apiTokenInstance}}"
payload = {}
headers= {}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/getWebhooksCount/{{apiTokenInstance}}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
.append({{apiUrl}})
.append("/waInstance").append({{idInstance}})
.append("/getWebhooksCount/")
.append({{apiTokenInstance}});
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("/getWebhooksCount/")
.append({{apiTokenInstance}});
var response = Unirest.get(requestUrl.toString())
.header("Content-Type", "application/json")
.asString();
System.out.println(response);
Sub GetWebhooksCount()
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}}/getWebhooksCount/{{apiTokenInstance}}"
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