Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $curl = curl_init();
- $accountID = 2;
- $fields = [
- "apiKey" => "qse8kv2bh9kzhyay6pz4wo9v1m7rdbva",
- "action" => "createTicket",
- "ticketInfo" => [
- "type" => "Individual",
- "summary" => "PhoneTicket",
- "description" => "Needs HELP",
- "status" => 1,
- "responsibleGroupID" => 3,
- "category" => 1,
- "ticketType" => 42,
- "customerID" => $accountID,
- "customerViewable" => 0
- ]
- ];
- curl_setopt_array($curl, array(
- CURLOPT_URL => "https://10.0.0.140:444/api/1/index.php",
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_TIMEOUT => 30,
- CURLOPT_CUSTOMREQUEST => "POST",
- CURLOPT_SSL_VERIFYPEER => false,
- CURLOPT_SSL_VERIFYHOST => false,
- CURLOPT_POSTFIELDS => http_build_query($fields),
- CURLOPT_HTTPHEADER => array(
- "Content-Type: application/x-www-form-urlencoded"
- ),
- ));
- echo('Create Ticket Posted');
- $response = curl_exec($curl);
- $err = curl_error($curl);
- if (!empty($err)) {
- echo "Error with API call. " . $err . " - " . curl_errno($curl);
- }
- echo('Create Ticket Postback');
- if ($response) {
- $results = json_decode($response);
- echo("Create Ticket Response:" . PHP_EOL);
- var_dump($results);
- } else {
- echo('Create Ticket Post Failed');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement