Hi,
I am trying to use the following code to connect to an API and then display the data to screen, however, at present when running the code nothing at all is displayed and nothing happens. I'm fairly new to PHP and just cannot figure out what I'm doing wrong. Please help!
<?php
ini_set('display_errors',"1");
function curl_request(){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://eu.myconnectwise.net/v2017_1/apis/3.0/services/tickets/13934");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: basic ' . base64_encode('#######'.'+'.'##########'.':'.'##########')));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close ($ch);
$obj = json_decode($json);
print ($obj['summary']);
}
print curl_request();
?>
The data structure of what I am trying to pull back is as follows:
Ticket {id(Integer)
* summary(String(100))
recordType(Enum)
board(BoardReference)
}