Hello there,
I successfully followed the api quickstart tutorial. However when I proceed the last PHP example, my new item is created, but four times. Why? Is it related to a specific board setting?
Thanks
Here is the code ($options and $board_id are defined earlier in the code)
$headers = ['Content-Type: application/json', 'Authorization: ' . $options['api_key']];
$query = 'mutation ($myItemName: String!, $columnVals: JSON!) { create_item (board_id:'.$board_id.', item_name:$myItemName, column_values:$columnVals) { id } }';
$vars = ['myItemName' => 'Prospects1',
'columnVals' => json_encode([
'email' => ['email'=>'zzzz@zz.fr', 'text'=>'zzzz@zz.fr']
])];
$data = @file_get_contents($options['api_end_point'], 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);