DersonTec
(ANDERSON EVANGELISTA BOAVENTURA)
November 9, 2020, 5:32pm
1
Hello developers, how are you?
I’m already a month trying to create a complete frame using the monday API, I need to create a line in a specific frame with the columns filled.
When I run the cod no error appears but the columns I want are not filled,
in the example below it creates more person columns and text does not complete
<?php
$token = "TOKEN";
$apiUrl = 'https://api.monday.com/v2';
$headers = ['Content-Type: application/json', 'Authorization: ' . $token];
$query = 'mutation ($myItemName: String!, $columnVals: JSON!) { create_item (board_id:"board_id", item_name:$myItemName, column_values:$columnVals) { id } }';
$vars = ['myItemName' => 'MAIS UMA LHAMA VERDE',
'columnVals' => json_encode([
'status' => ['label' => 'Ainda não iniciou'],
'date4' => ['date' => '2020-10-27'],
'person'=> ['multiple-person'=>'Anderson Boaventura'],
'text'=> ['texto'=>'Anderson Boaventura'],
])];
$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);
?>
Alguém poderia me ajudar ?
dsilva
(Daniel Silva)
November 10, 2020, 9:40pm
3
Hey @DersonTec - welcome to the community!
I think the code above may have gotten it’s formatting a bit mixed up when posting.
Just to confirm - are all columns not being populated?
-Daniel
1 Like
DersonTec
(ANDERSON EVANGELISTA BOAVENTURA)
November 11, 2020, 2:29pm
4
sorry for the mess, that the columns are not being filled and does not return even an error
dsilva
(Daniel Silva)
November 12, 2020, 10:14pm
5
Hey @DersonTec - I think the issue may be with the ‘multiple-person’ column - could you let us know what the columnID shows as on your board?
1 Like
DersonTec
(ANDERSON EVANGELISTA BOAVENTURA)
November 13, 2020, 10:41am
6
$vars = [‘myItemName’ => ‘MAIS UMA LHAMA VERDE’,
‘columnVals’ => json_encode([
‘status’ => [‘label’ => ‘Ainda não iniciou’],//ok
‘date4’ => [‘date’ => ‘2020-10-27’],//ok
‘person’=> [‘multiple-person’=>‘Anderson Boaventura’],//no
‘texto’=> [‘texto’=>‘Anderson Boaventura’],//no
])];
the column id D the column: person
and I would like to insert text in the column
Column ID: text
but none of the 2 columns accept that I add text