Skip to content
You're viewing an older version of this document. View the latest version
Created: 30 October 2024-Updated: 30 October 2024

gSMS API

The gSMS API provides a flexible interface designed to integrate sensor data into your custom applications and systems. Whether you’re monitoring environmental conditions, tracking equipment, or analyzing critical metrics, the gSMS API offers a streamlined way to collect, process, and utilize sensor information that is stored on our online portal.

In this manual, you will find all the information you need to get started, including endpoint details and request/response formats.

Bearer Token

Data is only accessible to eligible users. The enable secure data transfer, the gSMS API uses a Bearer Token for authentication. A Bearer Token is a type of access token used in authentication to grant secure access to a protected resource, such as this API. When a client includes a Bearer Token in the Authorization header of an HTTP request (formatted as Authorization: Bearer <token>), it serves as proof that the client is authorized to access specific resources. This token is typically issued by an authentication server and has a limited lifespan for security purposes, ensuring that only authenticated users or systems can access the API endpoints.

Endpoints

Login (get bearer token)

Endpoint
https://gsms.medusa-online.com/api/v1/login
Bearer token requiredno
Query params
email=<your_gSMS_portal_email>
password=<your_gSMS_portal_password>
DescriptionEndpoint to convert the login credentials to a bearer token that will be used in the following API calls
MethodPOST
Response
{
"status": "<success/error>",
"message": "<Optional message>"
"data": {"<Optional data object>"}
}
Example response
{
"status": "success",
"data": {
"type": "bearer",
"token": "<YOUR_BEARER_TOKEN>",
"refreshToken": null
}
}

Get sensors

Endpoint
https://gsms.medusa-online.com/api/v1/sensor
Bearer token requiredYes
Query params-
DescriptionEndpoint to get a list of sensors that are accessible by the user
MethodGET
Response
[<array of sensor objects>]
Example response
[
{
"id": 4,
"created_at": "2020-05-22 13:54:18",
"updated_at": "2021-08-19 15:34:55",
"e_id": "gSMS100-0004",
"stay_alive": false,
"meta": null,
"last_seen": "1593691215602"
},
{
"id": 9999,
"created_at": "2023-07-27 14:44:30",
"updated_at": "2024-04-08 10:18:51",
"e_id": "gSMS100-999",
"stay_alive": false,
"meta": null,
"last_seen": "1712564331625"
}
]

Get Data

Endpoint
https://gsms.medusa-online.com/api/v1/data
Bearer token requiredYes
Query paramsMandatory
The sensor id, which can be found using the get sensors endpoint.
sensor_id=<sensor_ID>

Optional (but recommended) time filtering
Use a UNIX timestamp in milliseconds (milliseconds since 1970, similar to the timestamp in all Medusa JSONS)
start_time=<start_timestamp>
end_time=<end_timestamp>

Optional filtering on type
This will select only stabilized (analyzed data) that contain radionuclide concentrations
stabData=true

Optional:
The fields that will be returned. When no fields are defined, all data is returned (include the spectrum). A subset of these fields can be used. The list below defines all the recommended fields, in combination with the stabData=true filtering.
fields=Timestamp
fields=Livetime
fields=Realtime
fields=Total
fields=K40
fields=U238
fields=Th232
fields=Press
fields=Temp
field=Hum
DescriptionEndpoint to get data from a specific sensor where the requested data can be specified
MethodGET
Response
[<array of data objects>]
Example response
[
{
"Timestamp": "1684063615552",
"Livetime": 897.289,
"Realtime": 900.013,
"Total": 50567,
"K40": 252.99,
"U238": 17.221,
"Th232": 21.392,
"Press": 1020.18,
"Temp": 18.85,
"Hum": 76.77
},
{
"Timestamp": "1684064516266",
"Livetime": 898.301,
"Realtime": 900.024,
"Total": 50223,
"K40": 240.002,
"U238": 18.574,
"Th232": 20.377,
"Press": 1020.14,
"Temp": 19.33,
"Hum": 76.81
},
...
]