I finally managed to get cron job working, and I would like to share my solution because it took me a while figuring it out.
The line I originally added to /etc/crontab was:
*/4 * * * * root /usr/bin/php /var/www/html/api/cron.php
but it had to be:
*/4 * * * * root /usr/bin/php-cgi /var/www/html/api/cron.php
Using the cgi version of php instead of the cli verison! This solution is deeply hidden somewhere on this forum, and I just want to help other people finding this solution in a hopefully faster way.
Thanks to the osTicket team and all the contributers.