Skip to main content

Domain URL

Every REST endpoint in this document is written as https://{domainURL}/api/v1/....

For this integration:

{domainURL} = https://backend.4dnum.com/

So the placeholder resolves like this:

In this documentActual request
https://{domainURL}/api/v1/result/{date}https://backend.4dnum.com/api/v1/result/2024-03-14
https://{domainURL}/api/v1/company-imagehttps://backend.4dnum.com/api/v1/company-image
note

Image and logo URLs returned inside responses are also built on the same origin — for example https://backend.4dnum.com/images/magnum.svg. Do not hard-code them; read them from the response so a future origin change does not break your client.

Keep the origin in one place so it can be swapped per environment.

src/api/client.js
const BASE_URL = process.env.API_BASE_URL || 'https://backend.4dnum.com';

export async function get(path) {
const res = await fetch(`${BASE_URL}/api/v1${path}`);
if (!res.ok) {
throw new Error(`4D API ${res.status}: ${path}`);
}
return res.json();
}

// get('/result/2024-03-14')
tip

If you are given a different origin for staging or by your PIC, change only API_BASE_URL — nothing else in this document assumes backend.4dnum.com.