nowinz Posted January 27, 2018 Share Posted January 27, 2018 (edited) Hello, ich have read many tutorials but my brain has paket loss I will use API for my dashing board (TV) but is not working for me here my php code <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://blub.de/includes/api.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query( array( 'action' => 'GetTicketCounts', // See https://developers.whmcs.com/api/authentication 'username' => 'xxxxxmycode', 'password' => mycode', 'ignoreDepartmentAssignments' => false, 'includeCountsByStatus' => true, 'responsetype' => 'json', ) ) ); $response = curl_exec($ch); if (curl_error($ch)) { die('Unable to connect: ' . curl_errno($ch) . ' - ' . curl_error($ch)); } curl_close($ch); // Decode response $jsonData = json_decode($response, true); // Dump array structure for inspection var_dump($jsonData); ------- output in browser {"result":"success","filteredDepartments":[1,2,3,4,5,6,7],"allActive":20"awaitingReply":10,"flaggedTickets":0,"status":{"open":{"title":"Open","count":4},"answered":{"title":"Answered","count":95},"customerreply":{"title":"Customer-Reply","count":6},"closed":{"title":"Closed","count":512},"onhold":{"title":"On Hold","count":0},"inprogress":{"title":"In Progress","count":0}}}int(1) how can dump/parse for example only awaitingReply i need only one output. Edited February 17, 2018 by WHMCS ChrisD Moved code into code boxes Link to comment Share on other sites More sharing options...
Ben_H Posted February 16, 2018 Share Posted February 16, 2018 Hey, If you are using dashing then I recommend taking a look at this on github. It currently displays open tickets but you could modify to be awaiting reply https://github.com/PhiGi87/dashing-whmcs-tickets/blob/master/jobs/whmcs.rb Ben Link to comment Share on other sites More sharing options...
nowinz Posted February 16, 2018 Author Share Posted February 16, 2018 Thanks for reply but this is for old whmcs system ? i have no accesskey = '123456' ?<< what is this? Link to comment Share on other sites More sharing options...
Recommended Posts