Get Latest Variable Data
Returns the most recently recorded value for the specified variable.
Endpoint
Section titled “Endpoint”GET /rest/v1/workspaces/{workspace_uuid}/devices/{device_identifier}/variables/{variable_identifier}/latestHeaders
Section titled “Headers”| Header | Value |
|---|---|
Authorization | Bearer <YOUR_API_KEY> |
Content-Type | application/json |
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_uuid | String | Yes | Unique identifier of the workspace. |
device_identifier | String | Yes | Unique identifier of the device within the workspace. |
variable_identifier | String | Yes | Unique identifier of the variable within the device. |
Example Request
Section titled “Example Request”GET /rest/v1/workspaces/01KXYZ123456789/devices/PLANT/variables/CURRENT/latestAuthorization: Bearer <YOUR_API_KEY>Success Response
Section titled “Success Response”Status: 200 OK
{ "data": { "t": 1784027551299, "v": "230.13978" }, "meta": { "message": "Latest variable data fetched successfully", "success": true }}Response Fields
Section titled “Response Fields”| Field | Description |
|---|---|
t | Timestamp of the latest recorded value in Unix milliseconds (UTC). |
v | Most recently recorded value for the variable. The value type depends on the variable’s data type (e.g, Number, Boolean, or String). |
Errors
Section titled “Errors”| HTTP Status | Description |
|---|---|
| 400 Bad Request | One or more required path parameters are missing or invalid. |
| 401 Unauthorized | Authentication failed due to a missing or invalid API key. |
| 404 Not Found | The specified workspace, device, or variable could not be found. |
| 500 Internal Server Error | An unexpected error occurred while retrieving the latest variable value. |