Hello Andrew,
since you want to send the code for execution, you will have to run the kernel gateway in websocket mode. That means it's not a simple HTTP/REST call with "execute this" in the request and "here's the result" in the response. The sequence is more like:
1. Check if an instance of the kernel is already running.
1a. Yes: get the ID of that instance.
1b No: start a new instance and use that ID.
2. Connect to the kernel via websocket.
3. Send code for execution through websocket.
4. Receive the result through websocket.
4a. If execution fails, you might see helpful error messages on other channels, also through websocket.
5. Disconnect from the kernel.
Have a look at this if you're working with JavaScript:
If you knew in advance what functions have to be executed, you could run the kernel gateway in notebook mode and get a simple request/response API. The notebook mode currently supports only a single notebook and kernel. You could either run one gateway for each kernel you need, or enhance the kernel gateway code to suit your needs.
hope that helps,
Roland