Basic PHP API v2 Example

Hi,

I am trying to create a page that would insert a new pulse on one of our boards. The above threads really helped and I was able to create a pulse with one column, however, when I am trying to insert data in each column I am getting a Parse error on " : " (STRING).

This is what I’m trying to run:

<?php $token = '[MY TOKEN]'; $tempUrl = "https://api.monday.com/v2/"; $name = "John"; $trainer = "Jeff"; $query = ' mutation{ create_item(board_id: xxxxxxx, group_id: "Active", item_name: "' . $name . '", column_values: "{"Trainer" : "' . $trainer . '", "Location" : "London", "Course" : "After Effects"}"){ id } } '; $headers = ['Content-Type: application/json', 'User-Agent: [MY TEAM] GraphQL Client', 'Authorization: ' . $token]; $data = @file_get_contents($tempUrl, false, stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => $headers, 'content' => json_encode(['query' => $query]), ] ])); $tempContents = json_decode($data, true); print_r($tempContents); ?>

Appreciate any help I can get guys !!

Thanks,