Need some API help

Need some API help

I am very new to development and API - so please bare with me. 

I am currently trying to use the API to see how many Open tickets I have in each department. 
Here is what I have so far 
  1. <?php

  2.     $auth_token = '***'; //your_auth_token
  3.     $org_id=***; //your_organization_id

  4.     $account_data=array(
  5.         "accountName"=>"Our Account",
  6.         "email"=>"example@email.com",
  7.         "website"=>"our website"
  8.     );

  9.     $headers=array(
  10.             "Authorization: $auth_token",
  11.             "orgId: $org_id",
  12.             "contentType: application/json; charset=utf-8",
  13.     );

  14.     $params="limit=40"; //options as parameters
  15.     $params2="field=status&departmentId=212694000000006907";
  16.     $params3="field=status&departmentId=212694000000127216";

  17.     $url="https://desk.zoho.com/api/v1/departments";
  18.     $url2="https://desk.zoho.com/api/v1/ticketsCountByFieldValues?$params2";
  19.     $url3="https://desk.zoho.com/api/v1/ticketsCountByFieldValues?$params3";

  20.     $ch_1 = curl_init($url);
  21.     $ch_2 = curl_init($url2);
  22.     $ch_3 = curl_init($url3);

  23.     curl_setopt($ch_1,CURLOPT_HTTPHEADER,$headers);
  24.     curl_setopt($ch_1,CURLOPT_RETURNTRANSFER,TRUE);
  25.     curl_setopt($ch_1,CURLOPT_HTTPGET,TRUE);
  26.     curl_setopt($ch_2,CURLOPT_HTTPHEADER,$headers);
  27.     curl_setopt($ch_2,CURLOPT_RETURNTRANSFER,TRUE);
  28.     curl_setopt($ch_2,CURLOPT_HTTPGET,TRUE);
  29.     curl_setopt($ch_3,CURLOPT_HTTPHEADER,$headers);
  30.     curl_setopt($ch_3,CURLOPT_RETURNTRANSFER,TRUE);
  31.     curl_setopt($ch_3,CURLOPT_HTTPGET,TRUE);

  32.     $mh = curl_multi_init();
  33.     curl_multi_add_handle($mh,$ch_1);
  34.     curl_multi_add_handle($mh,$ch_2);
  35.     curl_multi_add_handle($mh,$ch_3);

  36.     $running = null;
  37.     do {
  38.         curl_multi_exec($mh, $running);
  39.         } while ($running);

  40.     $response_1= curl_multi_getcontent($ch_1);
  41.     $response_2= curl_multi_getcontent($ch_2);
  42.     $response_3= curl_multi_getcontent($ch_3);

  43.     if($info['http_code']==200){
  44.         echo "<h2>Request Successful, Response:</h2> <br>";
  45.       }

  46.  else{
  47.         echo "Request not successful. Response code : ".$info['http_code']." <br>";
  48.         }

  49.      curl_multi_remove_handle($mh, $ch_1);
  50.      curl_multi_remove_handle($mh, $ch_2);
  51.      curl_multi_remove_handle($mh, $ch_3);
  52.      curl_multi_close($mh);

  53.      $ticketArray = json_decode($response_1, true);
  54.      $ticketCount_s = json_decode($response_2, true);
  55.      $ticketCount_b = json_decode($response_3, true);
  56.      $ticket = "".$ticketArray['data'][0]['name']." has ".$ticketCount_s['status'][1]['count']." open tickets <br>";
  57.      $ticket .= "".$ticketArray['data'][1]['name']." has ".$ticketCount_b['status'][1]['count']." open tickets";
  58.      echo $ticket;
  59.     #print_r($ticketArray);
  60. ?>
This will give me an output like this -- 
Support has 200 open tickets 
Sales has 123 open tickets

Which is what I am looking for - however is there any way to condense the code? or is everything I am doing correct?