Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

API Setup Error

Hi everyone,
I am just playing with getting the API system setup to accept tickets from a customer html form but coming across an error.

I am using the test script from but am getting an error of -

Unable to create ticket: API key not authorized

I have created three API keys and put them into the ost-api-example.php file.

1. For IP address of the external IP of the browser running the script (via
2. For the webserver IP address (by pinigng
3. For the loopback

But none of these work, can anyone shed any light on the error I am getting. I am not sure if the issue is the IP address tied to the API key or if there is something untoward going on with the API key I am submitting.

Thanks in advance for your help.



  • (iirc) You want to use the IP address of the webserver where the script/form resides.
  • Yeah tried that, but doesn't run.

    Can I disable to IP address validation to check if it makes any difference?

  • There is a way to do that in the source (I seem to recall a post here on the forums about that) you should be able to search for it.  But there is no way to do so using the ui.  Also make sure that you are using your webservers external ip address.  We had a similar issue here where we were using the internal ip address and should have been using the external.
  • Hi ntozier,
    Using phpinfo() I have tried both the SERVER_ADDR and REMOTE_ADDR and both return the same error.

    Reading a bit into the api php code it looks like the error I am getting is nothing to do with the IP address validation but just that the API key isn't being validated somehow.

    But I am not 100% about taking the validation out, I have had a quick search on the forum and the only article I can find says they have done it but doesn;t give instructions -

    This is frustrating as It was working under the previous version well.

  • *bump*
    Any one got anymore thoughts on this, otherwise I will need to roll out an older version that the API works in.

  • If you're pretty sure that this is a bug you can also report it on github. :)
  • Seems to be resolved by upgrading to 1.9.3.

    Thanks for your help.

Sign In or Register to comment.