Hello,I'm trying to create a ticket using the API. I'm following this guide:http://tmib.net/using-osticket-1812-apiI get the error:"Unable to create a Ticket"Here are the details of my setup:osTicket v1.9.12osTicket server URL: https://mydomain.edu/proves/scp/API key and IP: created and configuredServer from where I'm trying to create the ticket:Windows Server using IIS (Internet Information Service) web server. Using the php script provided in the previous tutorial.I tryied several URL without success:https://mydomain.edu/proves/scp/api/tickets.jsonhttps://mydomain.edu/proves/scp/api/http.php/tickets.jsonhttps://mydomain.edu/proves/api/http.php/tickets.json(...)Here I can see the logs but there are no logs related to my API tests:https://mydomain.edu/proves/scp/logs.phpThere is no error description or code so that I'm stuck. Is there a way I could test the JSON query from the browser in order to isolate the error?Thanks.

If I remember correctly "Unable to create ticket" is a generic osTicket error message.  I found that it is usually when someone tries to create a ticket with a mandatory field empty.  Make sure that you are passing all mandatory fields to the system.Your are using IIS.  IIS doesn't read .htaccess files.So you have to use:# NOTE: some people have reported having to use "http://your.domain.tld/api/http.php/tickets.json" instead.Have you consulted your PHP error logs?Also note that they may have changed the way lists are sent to the system.  Please consult the actualy documentation.https://github.com/osTicket/osTicket/blob/55dc25ace736baeaf224ee608cfabc0218022036/setup/doc/api/tickets.md

Got it!I had to add the following code to get the error description:if(curl_errno($ch)){            echo 'Request Error:' . curl_error($ch);            echo ("<br>");}Then the error was:cURL error: SSL certificate problem, verify that the CA cert is OK. Details: error routines verify failedSo I just addedcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);Working now. Thanks.

Write a Reply...