DeleteComment#
Beta version
The functionality is in beta. Features may change and may also work unstably.
The method deletes a comment.
You can delete a comment sent by the account or any comment under your own post.
If the comment has a branch of replies, the whole branch is deleted along with it.
The method uses the limits on the number of requests per second.
Request#
To delete a comment, you have to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/deleteComment/{{apiTokenInstance}}
For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Request parameters#
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
postId | string | Yes | The identifier of the post the comment is left under |
commentId | string | Yes | The identifier of the comment |
Request body example#
{
"postId": "2907515653209522683",
"commentId": "17912345678901234"
}
Response#
Response parameters#
| Field | Type | Description |
|---|---|---|
commentId | string | The identifier of the deleted comment - in the same form it was in the request |
Response body example#
{
"commentId": "17912345678901234"
}
DeleteComment errors#
For a list of errors common to all methods, refer to the Common errors section
| HTTP code | Error ID | Description |
|---|---|---|
| 400 | Bad Request Validation failed | Validation error |
| 400 | Validation failed. Details: 'postId' is required | The post is not specified |
| 400 | Validation failed. Details: 'commentId' is required | The comment is not specified |
Request examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/deleteComment/{{apiTokenInstance}}"
payload = {"postId": "2907515653209522683", "commentId": "17912345678901234"}
headers = {'Content-Type': 'application/json'}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/deleteComment/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"postId": "2907515653209522683", "commentId": "17912345678901234"}'