[go: up one dir, main page]

Skip to content

DeleteStatus#

Test Postman

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 for deleting status.

Request#

To delete a status, you have to execute a request at:

POST
{{apiUrl}}/waInstance{{idInstance}}/deleteStatus/{{apiTokenInstance}}

For apiUrl, idInstance and apiTokenInstance request parameters, refer to Before you start section.

Request parameters#

Parameter Type Mandatory Description
idMessage string Yes Deleted message ID

Request body example#

{
    "idMessage": "BAE5F4886F6F2D05"
}

Response#

Response parameters#

The response body is empty. If successful, the server response is 200.

DeleteStatus errors#

For a list of errors common to all methods, refer to Common errors section

HTTP code Error identifier Description
400 ID message notfound IDMessage is not found
403 Forbidden There is no access to the functionality of the beta version of the status methods. You can request access to the functionality via Green API support

Request examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/deleteStatus/{{apiTokenInstance}}"

payload = "{\r\n    \"idMessage\": \"BAE5F4886F6F2D05\" \"r\n}"
headers = {
  'Content-Type': 'application/json'
}

response = requests.post(url, json=payload)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/deleteStatus/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "idMessage": "BAE5F4886F6F2D05"
}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/deleteStatus/")
    .append({{apiTokenInstance}});

var headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);

var jsonBody = "{\"idMessage\": \"BAE5F4886F6F2D05\"}";

var requestEntity = new HttpEntity<>(jsonBody, headers);

var response = restTemplate.exchange(requestUrl.toString(), HttpMethod.POST, requestEntity, String.class);
System.out.println(response);
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/deleteStatus/")
    .append({{apiTokenInstance}});

var response = Unirest.post(requestUrl.toString())
    .header("Content-Type", "application/json")
    .body("{\"idMessage\": \"BAE5F4886F6F2D05\"}")
    .asString();

System.out.println(response);