CallsLogout#
Beta version
The functionality is in beta mode. Features are subject to change and may also work unstably. There may be additional charges for functionality in the future.
You can request access to the functionality via GREEN-API support
The method is used to log out the calls instance.
Request#
To log out the calls instance, you have to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/callsLogout/{{apiTokenInstance}}
For apiUrl, idInstance and apiTokenInstance request parameters, refer to Before you start section.
Response#
Response parameters#
| Parameter | Type | Description |
|---|---|---|
isLogout | boolean | Instance logout result |
Response body example#
{
"isLogout": true
}
Errors#
For a list of errors common to all methods, refer to Common errors section
| HTTP code | Description |
|---|---|
| 400 | Calls agent error |
| 404 | Instance not found |
| 500 | Log out error: ... — an error occurred during logout |
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/callsLogout/{{apiTokenInstance}}"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text.encode('utf8'))
curl --location --request POST '{{apiUrl}}/waInstance{{idInstance}}/callsLogout/{{apiTokenInstance}}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
.append({{apiUrl}})
.append("/waInstance").append({{idInstance}})
.append("/callsLogout/")
.append({{apiTokenInstance}});
var response = restTemplate.exchange(requestUrl.toString(), HttpMethod.POST, null, String.class);
System.out.println(response);
var requestUrl = new StringBuilder();
requestUrl
.append({{apiUrl}})
.append("/waInstance").append({{idInstance}})
.append("/callsLogout/")
.append({{apiTokenInstance}});
var response = Unirest.post(requestUrl.toString())
.header("Content-Type", "application/json")
.asString();
System.out.println(response);