Page 1 of 1

Externally exposed REST API. How?

PostPosted: Fri Jun 28, 2024 12:16 pm
by DannyC
I'm setting up the REST API for usage by external entities...in this case for Salesforce, but might be website/shops, WMS integrations, whatever.

Assume a SSL certificate has already been obtained, imported into the local cert store, bound to the URL which matches the URL in the JiwaAPISelfHostedService.exe.config file.

Entry has been made in the HOSTS file as per:
127.0.0.1 jiwaapi.mydomain.com.au

Inside the server, I can browse to the API using https://jiwaapi.mydomain.com.au:4444
All good. Note that only was successful after modifying the HOSTS file.

Now getting it accessed externally. What needs to happen? Who needs to be contacted?

Aside from the unique port getting opened on firewall(s), surely somehow the world needs to know about jiwaapi.mydomain.com.au?
Does the business need to get in touch with the domain host (like GoDaddy, VentraIP or whoever) to add a DNS entry?
If so, which record? A, CNAME, something else?

Anything else need to happen?

Re: Externally exposed REST API. How?

PostPosted: Fri Jun 28, 2024 12:24 pm
by Mike.Sheen
DannyC wrote:Aside from the unique port getting opened on firewall(s), surely somehow the world needs to know about jiwaapi.mydomain.com.au?
Does the business need to get in touch with the domain host (like GoDaddy, VentraIP or whoever) to add a DNS entry?
If so, which record? A, CNAME, something else?

Anything else need to happen?


Either an A record or a CNAME, depending on the setup.

An A Record will map the domain name jiwaapi.mydomain.com.au to the WAN IP Address - that will always work.

A CNAME should be used instead of an A Record is the machine already has an A Record - such as an AWS or Azure VM - in which case you create a CNAME record mapping jiwaapi to the machine's public DNS Record already in place.

Here is an example of our DNS CNAME for api.jiwa.com.au which points to an Azure VM which has a DNS A Record of apijiwacomau.australiaeast.cloudapp.azure.com
cloudflar_DNS_CNAME_JiwaAPI.png


An A Record will still work, but it's better to do a CNAME in this case in case the IP address changes for the existing record, so using a CNAME insulates you from that change so you won't need to update the DNS entry if the IP address does change.