Get data from monday - using foreach in php?

,

Hi All,
I’m trying to pull info from Monday and display a list of job numbers and connected clients.

When I query the board I’m using:

		boards (ids: 111) {
			items {
				  id
				  name
				column_values {
				  id
				  text
				  title
				  }
				}
			}
		}

The results to show:

{
  "data": {
    "boards": [
      {
        "items": [
          {
            "id": "project_number",
            "name": "project name",
            "column_values": [
              {
                "id": "subitems",
                "text": "",
                "title": "Subitems"
              },
              {
                "id": "connect_boards",
                "text": "Client Name",
                "title": "Client"
              },
              {
                "id": "rep",
                "text": "11586",
                "title": "Job No"
              },
              {
                "id": "timeline",
                "text": "2022-02-24 - 2022-02-24",
                "title": "Project Completion"
              },
              {
                "id": "dup__of_project_completion",
                "text": "2022-02-24 - 2022-02-24",
                "title": "Completion"
              },
              {
                "id": "quoted_hrs",
                "text": "0",
                "title": "Quoted Hrs"
              },
              {
                "id": "hours_taken",
                "text": "0",
                "title": "Hours Taken"
              },
              {
                "id": "status_16",
                "text": "",
                "title": "Status"
              },
              {
                "id": "people4",
                "text": "",
                "title": "People"
              },
              {
                "id": "status70",
                "text": "Yes",
                "title": "Production"
              },
              {
                "id": "numbers4",
                "text": "9999999",
                "title": "Quoted Price"
              },
              {
                "id": "dup__of_quoted_price",
                "text": "",
                "title": "Suppliers costs"
              }
            ]
          },

How can I get a list showing:

Project Name
Client Name
Job No

as I can’t work out what the query would need to be - I would need it to show all records (at the moment around 100 projects)

Is this possible or do I need to use php and run a foreach query?

Thanks in advance

Hello,
This is how I run queries to get information from Monday.com

$token = 'YOUR TOKEN HERE';
$apiUrl = 'https://api.monday.com/v2';
$headers = ['Content-Type: application/json', 'Authorization: ' . $token];

$query_1 = '{boards(ids:123456789) { name id items { name column_values{id type text } } } }';
$data = @file_get_contents($apiUrl, false, stream_context_create([
 'http' => [
 'method' => 'POST',
 'header' => $headers,
 'content' => json_encode(['query' => $query_1]),
 ]
]));
$responseContent = json_decode($data, true);

foreach($responseContent['data']['boards'][0]['items'] as $mydata){
  echo $mydata['name'] . "<br>";
}
?>