An API call or URL uses the HTTP protocol which is different from the TCP protocol. The way you connect to your TCP service would have to be with a TCP client.
We are not sure how you want to make the connection but maybe if you paint the scenario a bit better, then we might be able to help out.