Frontline API
The services, accounts and referrals on this site are test data. Referrals made here do not reach a service or a GP practice.
Frontline API
The API reads the library of local services and makes referrals into them. Everything below works against https://somewherefrontland.codeg.uy.
Authentication uses two tokens. Sign in with your Frontline account and both are shown on screen.
Get my keys Browse the API reference1Access and refresh tokens
Access token
Sent with every API call, as Authorization: Bearer ...
Expires after 180 minutes. Calls made with an expired token return 401.
Refresh token
Stored by your system, and exchanged for a new access token when one expires. It changes only when you regenerate it.
Treat it like a password.
Keep it on a server, never in a browser, a URL, or a source repository.
2Getting your keys
Sign in with your Frontline account and your keys are shown on screen, ready to copy. API access has to be switched on for your account first. If the page says it is not enabled, ask your Frontline contact to turn it on.
/apikeys
3Calling the API
Send the access token as a Bearer token on every request:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://somewherefrontland.codeg.uy/api/token/status
That endpoint reports who you are authenticated as. Use it to check a token works before writing anything else.
4Refreshing an expired token
After 180 minutes the access token stops working. Exchange your stored refresh token for a new one:
curl -X POST -H "Content-Type: application/json" \
-d "{ \"refreshToken\": \"YOUR_REFRESH_TOKEN\" }" \
https://somewherefrontland.codeg.uy/api/token/refresh
The response carries a new access token and the moment it expires:
{
"result": "OK",
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "8f3c1d2e-...",
"valid_to": "2026-09-17T14:32:00Z"
}
/api/token/refresh
You get a new access token, and carry on calling the API.
5Trying it without writing code
The API reference has a "Try it out" button on every endpoint. Click Authorize at the top of that page and paste your access token.
Bearer YOUR_ACCESS_TOKEN, including the word Bearer and
the space. The token on its own will not work.
Signing your own users in
To sign Frontline users in and call the API on their behalf, send them to
/apilogin?returnUrl=your-url. They are returned to you with
?token= appended.