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

Help with API key...

I am using osTicket 1.7 and am trying to set up the automatic pop/imap mail polling.

I have set up automatic task schedules with my server to access api/cron.php
I have set up an api key to look from the originating IP address of the scheduler.

I have no idea where I am supposed to set up the API key on the server.

I have read the following set of instructions...
Recurring tasks scheduler (host's custom task scheduler)

Some hosts do not allow adding cron jobs, and instead only allow you to probe scripts located at a publicly accessible URL. In this case, you will schedule the task using your webhost's scheduling interface and http://domain/path/to/osticket/api/cron.php.

To prevent unauthorized execution of scripts from the outside, Settings => API has rules for allowing external access based on originating IP and an API "passphrase", which is actually the User Agent string of the agent trying to access cron.php on your web server.

If the User Agent string is not changed to the API key, the request will be denied, email will not be polled, and API error - code #77: Unknown remote host [181.222.32.12] or invalid API key [Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.84 Safari/534.13] will appear in your system logs under the osTicket dashboard.

If your host allows you to modify their schedulers User Agent string, then change that to the API key and add your webhost scheduler's IP to Settings => API => API Keys.


My server doesn't seem to allow piping, so I have been trying to make osticket work with this email polling method. I can't figure out how to modify the user agent string. This was not an available option with my servers control panel at the time of scheduling a task.

I am using an iPower web hosting plan.
SQL 5.0.91
PHP 5.3.13
User Interface - vDeck v.4

My error log is showing API error #77 saying that an API key is required.

Any help will definately be appreciated. Thanks in advance.

Comments

  • Call cron.php using system (local) path, not the http interface. i.e /www/path/to/cron.php
  • My web-server has the "http://servername.com" before the entry box in it's task scheduler....so it doesn't seem to be looking for the local path.....and I can not remove http://servername.com from before the entry box.

    I tried it based on your suggestion...and while I did not see an error log in osticket for the time that I had that task scheduled for, it did not fetch the new emails either.

    Thanks for the response. Do you think I'm SOL as long as I am using this server host?
  • API error - code #77 polling with full URL

    I am having the same problem. Similarly, my host does not allow for Cron jobs using the local path. It forces the full public URL to my base folder (http://myserver.myhost.com/myaccountname/). osTicket is polling my email and creating tickets, but continues to throw this error every time.

    I understand that I will have to generate an API key based on the IP address of the server (easily found in the error message), which I have done. What I need is the format for specifying that API in the URL; example: http://myserver.myhost.com/myaccountname/osticiket/api/cron.php?aipkey=0123456789876543210

    I have searched the posts and support articles thoroughly, and while I found the instructions for generating the API, I have not seen the format for using it in a publically accessable URL

    I thank you all in advance for your help!

    - Brandon M. Trube
    AJT;34063 said:
    My web-server has the "http://servername.com" before the entry box in it's task scheduler....so it doesn't seem to be looking for the local path.....and I can not remove http://servername.com from before the entry box.

    I tried it based on your suggestion...and while I did not see an error log in osticket for the time that I had that task scheduled for, it did not fetch the new emails either.

    Thanks for the response. Do you think I'm SOL as long as I am using this server host?
  • edited February 2015
    Hi, I also have this problem. I need to know how to pass the api-key/passphrase to the external URL (which is the only format my webserver accepts). Very thankful for any help on the matter! :-)

    image
  • @henkemail
    so you are running osTicket 1.7?
    I think that perhaps you shouldn't zombie threads and might want to start your own.
This discussion has been closed.