Hi,
Just wondering if anyone can help here. I have been banging my head on the keyboard for hours over this and starting to change my mind about using Monday.com for our offices.
What I am trying to do is update a column value within the table of a worksheet using the value I have stored in a PHP variable, but it doesn’t work at all. Does anyone know what I am doing wrong?
Code below…
$token = [MYTOKEN];
$tempUrl = "https://api.monday.com/v2/";
$office_id = 212; //THIS VALUE IS ACTUALLY COMING FROM MYSQL DATABASE QUERY
$headers = ['Content-Type: application/json', 'User-Agent: [MYTEAM] GraphQL Client', 'Authorization: ' . $token];
$query = 'mutation ($columnVal: Int!) { change_column_value (board_id: [BOARD_ID], item_id: [ITEM_ID], column_id: [COLUMN_ID], value: $columnVal) { id } }';
$vars = $office_id;
$data = @file_get_contents($tempUrl, false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => $headers,
'content' => json_encode(['query' => $query, 'variables' => $vars]),
]
]));