Ok, well I fixed that error, there was a typo in the code which after reading a few timed I noticed.
I now get another error when I run the code which is bellow:
#!/usr/bin/php -q Unable to create ticket
You don't have permission to access /api/tickets.json on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Not too sure why I get the error. I have followed the instructions in the comments of the example code.
What was the typeO in the code? I get this error: PHP Parse error: syntax error, unexpected ';', expecting ')' in /home4/****/public_html/****/ost-api-example.php on line 45