I'm trying to use the API to create a new ticket using the script at http://forum.osticket.com/d/discussion//valid-api-key-required-trying-to-create-a-ticket-via-api However I'm stuck with the response from the script that says "You have not configured this script with your URL!" I cant see whats wrong. Using: 'url'=>'http://support.mydomain.com/api/http.php/tickets.json'  If I make up a incorrect url or take out the "http.php", the script says the API key is invalid so I am assuming it must recognise in part the url???The files listed in this folder are:/public_html/api/.htaccess/public_html/api/api.inc.php/public_html/api/cron.php/public_html/api/error_log/public_html/api/http.php/public_html/api/index.php/public_html/api/pipe.phpAny suggestions please?v1.8.1.2

Try thishttp://tmib.net/using-osticket-1812-api

Thanks for your response ntozier. I had used that and its a very useful article.  However I have got one step further now as what i had done was replace all instances of your.domain.tld which in line 23 I now realise was used to veryify that the URL had in fact been changed in line 18!So now what i get is right to the end of the script line 89 "Unable to create ticket: Valid API key required"I checked the api key, as inserted only in line 19, is actually what is listed as an api in ost (tried a couple apis). I checked the ip address used in the api key setup and that is correct. Also selected both  "Can Create Tickets (XML/JSON/EMAIL)" and "Can Execute Cron" Re the ip address, would it be a problem if the script is being called from a shared server (hostgator)?Any further ideas? I think its a great feature and would look forward to getting this working to take enquiries from a  web site form.

and yes the IP address used for api is the ip address of the server where the request is coming from ( that is where the script is being tested) .

Wondering if this provides any clues as to why the api to create a new ticket is not working....When using the api email piping feature for incoming emails, I need to change /api/pipe.php : - from "#!/usr/bin/php -q" to "#!/opt/php53/bin/php -q"- Make  executable chmod 755 so flying blind I played around with a number of permissions and for the http.php file:755: Unable to create ticket: Valid API key required644: Unable to create ticket: Valid API key required777: Unable to create ticket:        + ERROR 500 - INTERNAL SERVER ERRORany clues please??

Have you tried the comment in the ost-api-example.php?# NOTE: some people have reported having to use "http://your.domain.tld/api/http.php/tickets.json" instead.

yes have tried using http.php   

9 days later

I have not installed 1.9.1 yet, so nope.  Have you actually tried: http://your.domain.tld/api/http.php/tickets.json?Because your answer said http.php. Are you using mod_rewrite or mod_redirect etc?

I apologise I'm not a coder but have a very basic knowledge that has enabled me to manage ost thus far, so if you are able to help with padding out a bit more info that would be much appreciated. (eg I'm not familiar with reference to .tld and what is or where is tickets.json  plus your reference to mod_rewrite or mod_redirect??, so I dare say this must be my missing link???) Here's an extract from the code I used (replacing my domain with mydomain.com):// You must configure the url and key in the array below.

$config = array(

'url'=>'http://support.mydomain.com/api/http.php/tickets.json', // URL to site.tld/api/tickets.json

'key'=>'264ED201BD4E06B5D1D459078F5CAA87' // API Key goes here

);

Thanks for any further details you can provide...

.tld is an abbreviate for top level domain.  i.e. .org, .com, .net etc. Your snippet appears to be correct.mod_rewrite or mod_redirect are web server tools (modules) that allow people to redirect from A to B, or re-write the URL in the broswer from domain.tld/osticket to tickets.domain.tld (which really I would think people would use DNS to do.. but... /shrug)  If you don't know then chances are you're not.Have you also tried:http://your.domain.tld/api/tickets.json

Yes I have tried http://your.domain.tld/api/tickets.json

No ideas.  You should consult your PHP error logs and see if there is anything there. You should check and make sure that your API key is correct.  And make sure that the traffic is actually coming from where you think it is.

- no errors in php error log- api in ost API key is same as entered in test script  (mydomain.com/test2.php) - as above- IP address of API Key is same as results from "ping mydomain.com" Has anyone else been able to successfully use the API?

9 days later

Has anyone been able to successfully use the API or had similar problems?

I have been able to successfully do the API integration of OSTicket with Yii.If anyone is interested I will prepare a solution for you.

Geo99M6Z, I've come to a dead end so I'd certainly appreciate a solution if you could please. 

ntozier, does this give any clues...  the domain of my ost is support.mydomain.com  (mydomain of course replacing my actual domain)so in the code I use http://support.mydomain.com/api/tickets.jsonif I put that address in a browser it responds with "URL not supported" If I use http://mydomain.com/api/tickets.json it goes to my domain web site (tho page not found)So is this an issue because its a subdomain? 

a year later

infotec, i have the same problem like you now.i use 1.9.8.1followed all advice given above, API key is generated using the correct IP address.browser (IE/Chrome) result is always "Unable to create ticket: Valid API key required"any solution to share please?

infotec, i'm NOT using subdomain, i use v1.9.8.1 in a sub-folder.I tried both:api/tickets.jsonapi/http.php/tickets.jsonI still get browser error "URL not supported". So i don't think subdomain is the issue.my browser (IE/Chrome) result is always "Unable to create ticket: Valid API key required"