- Edited
Hello guys, I am able to create ticket but its only create ticket but i want to assigne ticket to member.I am using following script and adding assign to field but its not working.#!/usr/bin/php -q?php# Configuration: Enter the url and key. That is it.# url => URL to api/task/cron e.g # http://yourdomain.com/support/api/tickets.json# key => API's Key (see admin panel on how to generate a key)#$config = array( 'url'=>'http://domain.org/support/upload/api/http.php/tickets.json', 'key'=>'148DCB0jfjB794788CB1902E8DF906482' );# Fill in the data for the new ticket, this will likely come from $_POST.$data = array( 'name' => 'Nilesh Raut', 'email' => 'nilesh_raut@yahoo.com', 'subject' => 'Yahoo Test mail', 'assign to' => 'emaiId', // here i want to assign ticket. 'message' => 'Please provide credentials', 'ip' => $_SERVER, 'attachments' => array(),);/* * Add in attachments here if necessary$data =array('filename.pdf' => 'data/png;base64,' . base64_encode(file_get_contents('/path/to/filename.pdf'))); */#pre-checksfunction_exists('curl_version') or die('CURL support required');function_exists('json_encode') or die('JSON support required');#set timeoutset_time_limit(30);#curl post$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $config);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));curl_setopt($ch, CURLOPT_USERAGENT, 'osTicket API Client v1.7');curl_setopt($ch, CURLOPT_HEADER, FALSE);curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Expect:', 'X-API-Key: '.$config));curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);$result=curl_exec($ch);$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);curl_close($ch);if ($code != 201) die('Unable to create ticket: '.$result);$ticket_id = (int) $result;# Continue onward here if necessary. $ticket_id has the ID number of the# newly-created ticket?> How to assigne ticket using Json.