send the label with the api

I am looking for a way to send the tag with the api.
I didn’t see anything in the guide

For example, create task and set tags

$data = array('jsonrpc'=>'2.0',
              'method'=>'createTask',
              'id'=>'1',
	     'params'=> array ('owner_id'=> 0, 
	     'creator_id'=> 3,
             'date_due'=> '',
             'description'=> 'task_desk',
             'category_id'=> 0,
             'score'=> 0,
             'title'=> 'task_title',
             'project_id'=> 1,
             'column_id'=> 0,
             //add tags    
             'tags'=> array('tag1name'=> 'tag1content', 'tag2name'=> 'tag2content)
));

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,'KANBOARD_URL/jsonrpc.php');
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_USERPWD, 'jsonrpc:API_KEY');
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));

$result = curl_exec ($curl);
curl_close ($curl);

Thank you

and in json how to introduce it ?

{
"jsonrpc": "2.0", "method": "createTask", "id": 1176509098, "params": {"id": 58,"title":"CPI $titre","project_id": 1,"creator_id": 1,"date_due":"$new_date3 00:00","color_id":"yellow","column_id": "1"}} 

To which guide do you refer?

In the API Reference , you’ll find some nice examples. Otherwise, be more precise, please.

do i have to do like this?
"tags":(“test”:“yellow”)

thank you i found the answer.
the post may be resolved :wink:

Would you mind posting the solution you found here? This might be helpful or interesting for others. Thank you.

here is the solution i found,
I tried a lot of solutions that returned me “error parse”

{
"jsonrpc": "2.0", "method": "createTask", "id": 1176509098, "params": {"id": 58,"title":"CPI $titre","project_id": 1,"creator_id": 1,"date_due":"$new_date3 00:00","color_id":"yellow","column_id": "1","tags":["$transoprteur"]}} 
1 Like