curl --request POST \
--url https://api.telemax.com.au/api/GetSafetyScore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.telemax.com.au/api/GetSafetyScore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.telemax.com.au/api/GetSafetyScore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telemax.com.au/api/GetSafetyScore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.telemax.com.au/api/GetSafetyScore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.telemax.com.au/api/GetSafetyScore")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telemax.com.au/api/GetSafetyScore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"startTime": "2024-01-15T08:00:00Z",
"endTime": "2024-01-15T08:45:00Z",
"riskLevel": "Medium",
"riskScore": 62,
"duration": 2700,
"distance": 35.75
},
{
"startTime": "2024-01-16T14:10:00Z",
"endTime": "2024-01-16T14:50:00Z",
"riskLevel": "Low",
"riskScore": 20,
"duration": 2400,
"distance": 28.9
}
]{
"type": "AUTHENTICATION",
"code": "TOKEN_EXPIRED",
"description": "The access token has expired. Request a new token using /api/authentication/token/user or /api/authentication/token/api-key.",
"requestId": "req_7f3a2b1c",
"docUrl": "https://docs.telemax.com.au/errors#token-expired"
}{
"type": "AUTHORIZATION",
"code": "COMPANY_ACCESS_DENIED",
"description": "Your token does not grant access to company 99. Ensure you are using a token issued for this company.",
"requestId": "req_4a1d9e2f",
"docUrl": "https://docs.telemax.com.au/errors#company-access-denied"
}{
"type": "NOT_FOUND",
"code": "VEHICLE_NOT_FOUND",
"description": "Vehicle with ID 9999 was not found.",
"requestId": "req_2b8c1a5d",
"docUrl": "https://docs.telemax.com.au/errors#not-found"
}{
"type": "VALIDATION",
"code": "INVALID_DATE_FORMAT",
"description": "The 'from' parameter '2025-13-45' is not a valid ISO 8601 date-time string.",
"requestId": "req_9f3e7c1b",
"docUrl": "https://docs.telemax.com.au/errors#invalid-parameter"
}{
"type": "RATE_LIMIT",
"code": "RATE_LIMIT_EXCEEDED",
"description": "Too many requests. Wait 30 seconds before retrying.",
"requestId": "req_6d2f8b4a",
"docUrl": "https://docs.telemax.com.au/errors#rate-limit"
}{
"type": "SERVER_ERROR",
"code": "INTERNAL_ERROR",
"description": "An unexpected error occurred. Please try again or contact support with the requestId.",
"requestId": "req_1e5a3c7d",
"docUrl": "https://docs.telemax.com.au/errors#server-error"
}Safety score
Trip safety score for a legacy vehicle over a date range.
curl --request POST \
--url https://api.telemax.com.au/api/GetSafetyScore \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.telemax.com.au/api/GetSafetyScore"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.telemax.com.au/api/GetSafetyScore', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telemax.com.au/api/GetSafetyScore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.telemax.com.au/api/GetSafetyScore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.telemax.com.au/api/GetSafetyScore")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telemax.com.au/api/GetSafetyScore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"startTime": "2024-01-15T08:00:00Z",
"endTime": "2024-01-15T08:45:00Z",
"riskLevel": "Medium",
"riskScore": 62,
"duration": 2700,
"distance": 35.75
},
{
"startTime": "2024-01-16T14:10:00Z",
"endTime": "2024-01-16T14:50:00Z",
"riskLevel": "Low",
"riskScore": 20,
"duration": 2400,
"distance": 28.9
}
]{
"type": "AUTHENTICATION",
"code": "TOKEN_EXPIRED",
"description": "The access token has expired. Request a new token using /api/authentication/token/user or /api/authentication/token/api-key.",
"requestId": "req_7f3a2b1c",
"docUrl": "https://docs.telemax.com.au/errors#token-expired"
}{
"type": "AUTHORIZATION",
"code": "COMPANY_ACCESS_DENIED",
"description": "Your token does not grant access to company 99. Ensure you are using a token issued for this company.",
"requestId": "req_4a1d9e2f",
"docUrl": "https://docs.telemax.com.au/errors#company-access-denied"
}{
"type": "NOT_FOUND",
"code": "VEHICLE_NOT_FOUND",
"description": "Vehicle with ID 9999 was not found.",
"requestId": "req_2b8c1a5d",
"docUrl": "https://docs.telemax.com.au/errors#not-found"
}{
"type": "VALIDATION",
"code": "INVALID_DATE_FORMAT",
"description": "The 'from' parameter '2025-13-45' is not a valid ISO 8601 date-time string.",
"requestId": "req_9f3e7c1b",
"docUrl": "https://docs.telemax.com.au/errors#invalid-parameter"
}{
"type": "RATE_LIMIT",
"code": "RATE_LIMIT_EXCEEDED",
"description": "Too many requests. Wait 30 seconds before retrying.",
"requestId": "req_6d2f8b4a",
"docUrl": "https://docs.telemax.com.au/errors#rate-limit"
}{
"type": "SERVER_ERROR",
"code": "INTERNAL_ERROR",
"description": "An unexpected error occurred. Please try again or contact support with the requestId.",
"requestId": "req_1e5a3c7d",
"docUrl": "https://docs.telemax.com.au/errors#server-error"
}Overview
Returns trip safety score payload fromISafetyScoreService for a legacy vehicle id over a date range.
Endpoint
POST /api/GetSafetyScore
Query parameters
start and finish are omitted: 1 = instant range (see
note), 2 = relative to end of local day, 3 = three-day window, 4 = week
window—implementation uses finish - TimeSpan.FromDays(-N) which adds days
to finish.intervalType).intervalType).⚠️ Note: Whenstartandfinishare omitted,finishis derived from “today” in the user’s timezone andintervalTypeselectsstartper the switch inGetSafetyScoreAsync. The arithmetic uses-TimeSpan.FromDays(-k)(double negative), which adds days tofinishfor types 2–4. ForintervalType1,startis set toDateTime.UtcNow. Validate ranges in staging before relying on preset windows.
Response
200 OK — array of trip safety score objects.| Field | Type | Description |
|---|---|---|
startTime | string (datetime) | Trip start time |
endTime | string (datetime) | Trip end time |
riskLevel | string | "Low", "Medium", or "High" |
riskScore | integer (0–100) | Numeric risk score; lower is safer |
duration | integer | Trip duration in seconds |
distance | number | Trip distance in km |
Error responses
| Status | Meaning |
|---|---|
| 404 | Unknown legacy vehicle |
| 401 | Vehicle or user/company not allowed |
| 400 | "Invalid date range specified." or generic “An error occurred while attempting to fetch the safety scores…” |
Authorizations
JWT Bearer token obtained from POST /api/authentication/token/user or POST /api/authentication/token/api-key.
Lifetime: ~24 hours (86,399 seconds). Cache the token and reuse it. Re-authenticate 5 minutes before expiry.
Scoping:
- User tokens are scoped to a single company.
- API key tokens may restrict access to a vehicle allowlist and/or action set (see token claims).
No refresh endpoint — re-authenticate with your credentials when the token expires.
Headers
Bearer your_token
Query Parameters
Legacy vehicle ID.
Preset window (used only when start/finish are omitted). 1 = instant range, 2 = relative to end of local day, 3 = three-day window, 4 = week window. Note: the implementation uses a double-negative offset (finish - TimeSpan.FromDays(-N)) which adds days to finish for types 2–4. Validate in staging before relying on preset windows.
Range start (ISO 8601 UTC). Optional when using intervalType.
Range end (ISO 8601 UTC). Optional when using intervalType.
Response
Successful response with array of trip safety score data
Trip start time (also used as trip ID component)
"2024-01-15T08:00:00Z"
Trip end time
"2024-01-15T08:45:00Z"
Human-readable risk level
"Medium"
Risk score (0–100)
0 <= x <= 10062
Trip duration in seconds
2700
Total distance in kilometers
35.75
Was this page helpful?