I went further down and tried another section of the tutorial for creating an item since that is what I’m trying to achieve anyway and that section is free of typos. Still getting ‘null’
So this is my code:
<?php
$token = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$apiUrl = 'https://api.monday.com/v2';
$headers = e'Content-Type: application/json', 'Authorization: ' . $token];
$query = 'mutation{ create_item (board_id:XXXXXXXXX, item_name:"HELLO WORLD!") { id } }';
$data = @file_get_contents($apiUrl, false, stream_context_create(r
'http' => =
'method' => 'POST',
'header' => $headers,
'content' => json_encode(n'query' => $query]),
]
]));
$responseContent = json_decode($data, true);
echo json_encode($responseContent);
?>
Pretty sure my PHP env is working, if I replace this code with code that just echos html it works.
Anyone know where I’m going wrong?
Thanks!
Hello there @hderic,
I see the article is now fixed 🙂
Regarding your issue, would you please send an email to appsupport@monday.com so we can take care of it over there?
Please include the script you are using and the exact response you get.
Please also send a screenshot of your Playground trying that query there. Include in the screenshot the query and the response please.
To use the Playground:
Click on your profile picture or initials
Click on “Developers”
Click on “Developer”
Click on “API Playground”
Looking forward to hearing from you 🙂
Cheers,
Matias