What is the syntax WebGUI Bitrix containing array?

Send a request to the api of Bitrix24 to create a comment to a task.
/task.commentitem.add/?TASKID=&FIELDS[]=[{'POST_MESSAGE':'HELLO'}]
Get the error message.
Param #1 (arFields) for method ctaskcommentitem::add() must not contain key \u00220\u0022.; 256\/TE\/WRONG_ARGUMENTS

UPD:
If I do the query
/task.commentitem.add/?TASKID=xxx&FIELDS[POST_MESSAGE]=HELLO
Get a different error message
Too much params(4) given for method ctaskcommentitem::add(), but expected not more than 2

What is the syntax supposed to be?
March 19th 20 at 08:27
1 answer
March 19th 20 at 08:29
Solution
You incorrectly interpreted the documentation to the appropriate web hook (task.commentitem.add).

Your query really should look like this:
/task.commentitem.add/?TASKID=xxx&FIELDS[POST_MESSAGE]=HELLO

And no curly braces as you see there, and the only Array there is one key in the FIELDS.
I have this option tried. The result
Too much params(4) given for method ctaskcommentitem::add(), but expected not more than 2 - Elise26 commented on March 19th 20 at 08:32
@Elise26, can result in a code which the request is formed? - Margot80 commented on March 19th 20 at 08:35
@Margot80, first get the token then

import requests

url = "https://site.ru/rest/userid/key/task.commentitem.add/?TASKID=taskid&FIELDS[POST_MESSAGE]=HELLO"
query = {'auth': access_token}
r = requests.post(url, params=query)
- Elise26 commented on March 19th 20 at 08:38
@Elise26, something you have to request not.

Suppose that on the website portal24.ru I user 10 has webhook 4kx8y1c4g26k1jbt and want to the task with ID 1 comment HELLO.

I need to send another request (e.g. a GET request):
https://portal24.ru/rest/10/4kx8y1c4g26k1jbt/task.commentitem.add/?TASKID=1&FIELDS[POST_MESSAGE]=HELLO


Where did you get the auth?
Is the query text (the text itself) which is sent? - Margot80 commented on March 19th 20 at 08:41
@Margot80, You are right, if you don't send the auth, the request is performed. - Elise26 commented on March 19th 20 at 08:44
@Elise26, select the solution then :) - Margot80 commented on March 19th 20 at 08:47

Find more questions by tags Bitrix24APIPython