Is there a way to "route" HTTP (API) calls via PHP? Basically I have 3 systems. System A can reach system B and System B can reach System C. However, system A cannot reach system C. Is there an easy to route my API calls to System B which can act as a the middleman and communicate with System C and then B can respond to A with the call result?
What you’re trying to create is a proxy. This can very well done with PHP. The following code is a very simple implementation of a proxy, reading POST data, submitting them to a different URL, and returning the result to the original client:
This is just an example, and it makes several assumitions (payload is POST data, response is gzipped, etc.)
Feel free to adapt the code to your needs, or have a look at various more advanced implementations of PHP-based proxies, e.g. https://github.com/jenssegers/php-proxy.