Skip to main content

hey , im trying to add multiple columns to new record in one time

and its always ignore from the phone and doesnt sign it


 $vars = [
'leadName' => $data['item_name'],
'columns' => json_encode([
'email' => ['email' => $data['email'], 'text' => $data['email']],
'phone' => ['phone' => 972525938456, 'countryShortName' => IL],
'text' => "test"
])
];


$query = 'mutation ($leadName: String!, $columns: JSON!) {
create_item (board_id:'.$data['board_id'].', item_name:$leadName, column_values:$columns
) { id } }';


$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => "https://api.monday.com/v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode(['query' => $query, 'variables' => $vars]),
CURLOPT_HTTPHEADER => array(
"content-type: application/json",
"Authorization: ".$data['token']
),
));

any solutions ?

Hello @dorlevy and welcome to the community!


I believe your issue could reside in the fact that you don’t seem to be passing the countryShortName as a string.


Here is an example I just made and is working properly in the playground:


mutation {
change_column_value(board_id: 1122334455, item_id: 12345678, column_id: "phone9", value: "{\\"phone\\":\\"972525938456\\",\\"countryShortName\\":\\"IL\\"}") {
id
}
}

Hope this helps!


Cheers,

-Matias


actually the problem was that the column_id is phone_1 and not only phone

but for other calls i will remeber your advice


thanks!


Reply