LastOutgoingCalls#
Beta version
The functionality is in beta mode. Functions can be changed and may also work unstably.
This method returns the latest outgoing calls of the account.
Settings
To receive calls from phone you need to enable the outgoingCallWebhook using the SetSettings or Get notifications about outgoing calls through the console.
It may take up to 5 minutes for the settings to take effect.
To receive the latest outgoing calls of your phone before connecting the instance, after saving the settings on the instance, you need to do logout and authorize again.
The method returns the last 10000 calls. The LastOutgoingCalls method only returns the history that WhatsApp provides to the system.
The appearance of calls history in the journal may take up to 2 minutes. Journal methods should only be used for retrieving calls history. For quicker calls retrieval, use the notification system.
Request#
To get outgoing calls history, you have to execute a request at:
{{apiUrl}}/waInstance{{idInstance}}/lastOutgoingCalls/{{apiTokenInstance}}
For apiUrl, idInstance and apiTokenInstance request parameters, refer to Before you start section.
URL request parameters#
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
minutes | integer | No | time in minutes for which the calls should be displayed (default is 1440 minutes) |
Response#
Response parameters#
Array of objects with parameters:
| Parameter | Type | Description |
|---|---|---|
type | string | Call type, outgoing - outgoing call |
idMessage | string | Outgoing call Id |
timestamp | integer | Call end time in UNIX format |
typeMessage | string | Call type: outgoingCall - outgoing call |
chatId | string | Chat Id, in which the call was made |
duration | integer | Call duration in seconds |
isVideo | boolean | Flag indicating whether this was a video call |
status | string | Call status. Can have the following values: |
pickUp - at least one participant answered the call | ||
hungUp - all participants did not accept the call, or the number to which the call was made does not have a WhatsApp account. | ||
invalid - The call failed or the status couldn't be processed. For example, the number I was calling doesn't exist. | ||
participants | array | Call status for each participant. In private calls, this field will only contain one object. |
Parameters of participants object:
| Parameter | Type | Description |
|---|---|---|
id | string | Chat Id call participant |
status | string | The call status for a specific participant. Can take the following values: |
pickUp - participant picked up the phone | ||
hungUp - participant didn't answer the call or the number you called doesn't exist | ||
declined - participant declined the call | ||
invalid - the call failed or the status couldn't be processed |
Response body example#
[
{
"type": "outgoing",
"idMessage": "AC0E17D82A7B513089H667F636DD2AE5",
"timestamp": 1754455789,
"typeMessage": "outgoingCall",
"chatId": "120363153000000000@g.us",
"duration": 22,
"isVideo": false,
"status": "pickUp",
"participants": [
{
"id": "79111234567@c.us",
"status": "pickUp"
},
{
"id": "79222234567@c.us",
"status": "hungUp"
}
]
},
{
"type": "outgoing",
"idMessage": "F33E8701AGHY4DE04254CBBAE21EC046",
"timestamp": 1754455763,
"typeMessage": "outgoingCall",
"chatId": "79111234567@c.us",
"duration": 3,
"isVideo": false,
"status": "pickUp",
"participants": [
{
"id": "79111234567@c.us",
"status": "pickUp"
}
]
},
{
"type": "outgoing",
"idMessage": "F33E8701AGHY4DE04254CBBAE21EC046",
"timestamp": 1754455763,
"typeMessage": "outgoingCall",
"chatId": "79111234567@c.us",
"duration": 0,
"isVideo": false,
"status": "declined",
"participants": [
{
"id": "79111234567@c.us",
"status": "declined"
}
]
},
{
"type": "outgoing",
"idMessage": "F33E8701AGHY4DE04254CBBAE21EC046",
"timestamp": 1754455763,
"typeMessage": "outgoingCall",
"chatId": "79111234567@c.us",
"duration": 0,
"isVideo": false,
"status": "invalid",
"participants": [
{
"id": "79111234567@c.us",
"status": "invalid"
}
]
}
]
LastOutgoingCalls errors#
For a list of errors common to all methods, refer to Common errors section
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/lastOutgoingCalls/{{apiTokenInstance}}"
payload = {}
headers= {}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/lastOutgoingCalls/{{apiTokenInstance}}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
.append({{apiUrl}})
.append("/waInstance").append({{idInstance}})
.append("/lastOutgoingCalls/")
.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("/lastOutgoingCalls/")
.append({{apiTokenInstance}});
var response = Unirest.get(requestUrl.toString())
.header("Content-Type", "application/json")
.asString();
System.out.println(response);
Sub LastOutgoingCalls()
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}}/lastOutgoingCalls/{{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