6. Call your API
Your address
Your API's address is on the deployment page, under Endpoint URL and in the Endpoints section. It looks like this:
Script 6.1: The form of an API address
https://<ref>.multiconnectcloud.app
<ref> is a short code given to the deployment when it is created. It is not the deployment name, so renaming a deployment never changes its address. Older deployments use https://<ref>.endpoint.multiconnectcloud.com.
HTTPS is handled by MultiConnectCloud; your code serves plain HTTP. Nothing extra is needed in a request: no platform key and no special header. Authentication is up to your code.
Script 6.2: Call your API
curl -s https://<ref>.multiconnectcloud.app/health
Script 6.3: Call your API from JavaScript
const r = await fetch('https://<ref>.multiconnectcloud.app/');
console.log(await r.json());
Moving to the new address
If your deployment was created on the older address, the Endpoints section shows its new address. Once your apps and clients use the new one, click the button, tick Yes, my apps and clients now use the new domain, and click Confirm. Undo puts the old address back as the main one. The old address keeps working for now, but it will be retired later, so update anything that still uses it.
WebSockets
With Web Socket set to On, clients can open wss:// connections to the same hostname. Idle connections are closed after a while, so have clients send a ping about every 30 seconds.

