Hello every one, I need some help please.
I use a simple board, an item is assigned to a group of person. This is the structure :
{“name”:“Thing to do”,“column_values”:[{“id":“person”,“type”:“multiple-person”,“text”:"user1@mydom.com, user2@mydom.com”},{“id”:“status”,“type”:“color”,“text”:“Done”},{“id”:“timeline”,“type”:“timerange”,“text”:“2022-09-19 - 2022-10-01”},{“id”:“texte8”,“type”:“long-text”,“text”:“Good job”}]}
I managed to folow the QuickStart PHP Api Guide and populate the main Label, the status and the last “text8” label.
But I can’t manage to populate the timeline column and most of all, the person column.
I think there is something about Person ID (I managed to find all the IDs).
I tried this :
$headers = ['Content-Type: application/json', 'Authorization: ' . $token];
$query = 'mutation ($myItemName: String!, $columnVals: JSON!) { create_item (board_id:XXXXXXXXX, item_name:$myItemName, column_values:$columnVals) { id } }';
$vars = ['myItemName' => 'Thing to do',
'columnVals' => json_encode([
'status' => ['label' => 'Done'],
'person' => ['text' => 'user1@mydom.com'],
'date4' => ['date' => '2022-09-15'],
'texte8' => ['text' => 'Good job']
])];
$data = @file_get_contents($apiUrl, false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => $headers,
'content' => json_encode(['query' => $query, 'variables' => $vars]),
]
]));
$responseContent = json_decode($data, true);
echo json_encode($responseContent);
I guess that the ‘date4’ should be replaced by the right ID,
and i suspect a wrong structure for “person”.
Anyone to help me with that simple code?