V
V
Vyacheslav2019-03-25 13:22:22
Python
Vyacheslav, 2019-03-25 13:22:22

What is the syntax of the Bitrix webhook containing array?

I send a request to the Bitrix24 api to create a comment on the task.
/task.commentitem.add/?TASKID=&FIELDS[]=[{'POST_MESSAGE':'HELLO'}] I'm getting
an error message.
Param #1 (arFields) for method ctaskcommentitem::add() must not contain key \u00220\u0022.; 256\/TE\/WRONG_ARGUMENTS
UPD:
If I make a request like
/task.commentitem.add/?TASKID=xxx&FIELDS[POST_MESSAGE]=HELLO
I get a different error message
Too much params(4) given for method ctaskcommentitem::add() , but expected not more than 2
What should be the syntax?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2019-03-25
@ElefanObi

You misinterpreted the documentation for the relevant webhook (task.commentitem.add) .
Your request should actually look like this:
/task.commentitem.add/?TASKID=xxx&FIELDS[POST_MESSAGE]=HELLO
And as you can see, there are no curly braces there, and the only Array that is there is one key in FIELDS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question