Question Creative solutions needed for interacting with API

rh71

No Lifer
Aug 28, 2001
52,853
1,048
126
I have to transition an existing ColdFusion web application to PHP because of cost. The CF app uses cfhttp to talk to another team's [JSON] API (which creates a ticket given the info we feed it and the API returns a ticket#). The PHP hosting team does not allow API calls, presumably due to security. Is there any other way to do this? The cfhttp substitute would have been cURL in PHP, but is this security restriction a showstopper? Can I utilize Java in some way (not very well versed) or other workarounds?
 

purbeast0

No Lifer
Sep 13, 2001
52,871
5,742
126
I'm not really following what you mean by "they don't allow API calls". All an API call is hitting an http endpoint. If you are saying that wherever the PHP is running from, they won't allow you to hit any http endpoints, then I don't believe there is anything you can do, since they simply won't let you interact with other domains.

I don't know much about php generally speaking, but is all you are doing a GET request passing in parameters? If so can you use http_get which is part of PHP?

http://php.net/manual/fa/function.http-get.php