- Edited
I have one core php aaplication i want to osticket connect with my application and also fetch osticket form field in my costume html form.
I have one core php aaplication i want to osticket connect with my application and also fetch osticket form field in my costume html form.
@[deleted]You are going to have to try to explain your question(s) with much more detail if you hope to get anyone to understand and help you.What core PHP application are you referring to?What form field are you hoping to call from another form?I certainly cannot help you, but hopefully someone else can... if you provide the right information.
I have created basic application in php. login ,registeration,and also created osticket form in html.i have also use your standed codebelow code who i say
<?php$debug="0";$config = array( 'url'=>'domain url/upload/api/tickets.json', // URL to site.tld/api/tickets.json 'key'=>'2F981A8B7B1B91546ACAEC695CDAED8B' // API Key goes here);$data = array( 'name' => $name, // from name aka User/Client Name 'email' => $email, // from email aka User/Client Email 'subject' => $subject.$program, // test subject, aka Issue Summary 'program' => $program, 'status' => $status, // phone number aka User/Client Phone Number 'quest' => $topicq, 'message' => 'Ticket created for '.$program.' Question : -'.$topicq, // test ticket body, aka Issue Details. 'ip' => $_SERVER, // Should be IP address of the machine thats trying to open the ticket. 'topicId' => $topicId, // the help Topic that you want to use for the ticket 'attachments' => array());if($debug=='1') { print_r($data); die();}$data =array('file.txt' => 'data/plain;base64;' .base64_encode(file_get_contents('/file.txt'))); // replace ./file.txt with /path/to/your/test/filename.txt
function_exists('curl_version') or die('CURL support required');function_exists('json_encode') or die('JSON support required');set_time_limit(30);$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.8');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; if(isset($ticket_id) && $ticket_id!='') { echo "Ticket Created Sucessfully"; }else{ echo "Ticket not created. Try again later."; } function IsNullOrEmptyString($question){ return (!isset($question) || trim($question)==='');}?>
just smiple that i want to osticket connect with my application with field.