Hi developer group! I am trying to get the PHP API up and running, however I only receive the word NULL when accessing the php file in browser.
Here is my code where ‘MY_TOKEN’ is my security token.
<?php
$token = 'MY_TOKEN';
$apiUrl = 'https://api.monday.com/v2';
$headers = ['Content-Type: application/json', 'Authorization: ' . $token];
$query = '
{
boards(ids: 3598566708) {
groups(ids: "new_group") {
items {
id
name
column_values {
title
text
}
}
}
}
}
';
$data = @file_get_contents($apiUrl, false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => $headers,
'content' => json_encode(['query' => $query]),
]
]));
$responseContent = json_decode($data, true);
echo json_encode($responseContent);
?>