Skip to content

SendLikeToComment#

Beta version

The functionality is in beta. Features may change and may also work unstably.

The method sets a like on a comment, and with the like = false field it removes the like.

The identifier of the comment is enough - there is no need to specify the post.

The method uses the limits on the number of requests per second.

Request#

To set a like, you have to execute a request at:

POST
{{apiUrl}}/waInstance{{idInstance}}/sendLikeToComment/{{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
like boolean No true - set a like, false - remove it. The default is true

Request body example#

Set a like to a comment:#

{
    "postId": "2907515653209522683",
    "commentId": "17912345678901234",
    "like": true
}

Remove a like from a comment:#

{
    "postId": "2907515653209522683",
    "commentId": "17912345678901234",
    "like": false
}

Response#

Response parameters#

Field Type Description
commentId string The identifier of the comment from the request

Response body example#

{
    "commentId": "17912345678901234"
}

SendLikeToComment 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}}/sendLikeToComment/{{apiTokenInstance}}"

payload = {"postId": "2907515653209522683", "commentId": "17912345678901234", "like": True}
headers = {'Content-Type': 'application/json'}

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

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/sendLikeToComment/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"postId": "2907515653209522683", "commentId": "17912345678901234", "like": true}'