note

This API gets the most recent raw value entered in the specified tag. For more details, refer to the parameter below.

This API gets the most recent raw value entered in the specified tag. For more details, refer to the parameter below.

HTTP Request

GET https://{lake_id}.machlake.com/lakes/values/current
Content-Type: application/json; charset=utf8
x-api-key: {API Key}

Parameters

Optional

Type

Description

Example

tag_name

string

tag name with , separator

&tag_name=tag1,tag2,tag3

date_format

string

date format of select time
or
timestamp type ("SECOND", "MILLISECOND", "MICROSECOND", "NANOSECOND")

&date_format=YYYY-MM-DD HH24:MI:SS
or
&date_format=MILLISECOND

(default : YYYY-MM-DD HH24:MI:SS)

columns

string

columns to filter out

&columns=value,value2 (default : value)

separator

string

separator for tag_name, columns, and_condition

&separator=| (default : ,)

aliases

string

columns to be aliased (If Empty orthe columns is incorrect, an error will occur)

&aliases=myvalue,myvalu2

value_return_form

int

result set format

Optimized for various chart libraries and configured to return

0 : separate standard (default)
or
1 : merged standard

Request Example

GET https://api.machlake.com/lakes/{lake_id}/values/current?tag_name=tag_01,tag_02&columns=VALUE&aliases=MyVal&value_return_form=0
Content-Type: application/json; charset=utf8
x-api-key: {API Key}

Response Example

Status 200

// return format = 0
{
    "status": "success",
    "data": {
        "calc_mode": "raw",
        "columns": [
            {"name": "TIME", "type": 5, "length": 4096},
            {"name": "MyVal", "type": 20, "length": 17}
        ],
        "samples": [
            {
                "tag_name": "tag_02",
                "data": [{"MyVal": 1629,"TIME": "2021-07-06 12:12:27"}]
            },
            {
                "tag_name": "tag_01",
                "data": [{"MyVal": 1625,"TIME": "2021-07-06 12:12:25"}]
            }
        ]
    }
}
 
// return format = 1
{
    "status": "success",
    "data": {
        "calc_mode": "raw",
        "columns": [
            {"name": "TIME", "type": 5, "length": 4096},
            {"name": "MyVal", "type": 20, "length": 17}
        ],
        "samples": [
            {
                "tag_name": "tag_02",
                "data": {
                    "MyVal": [1629],
                    "TIME": ["2021-07-06 12:12:27"]
                }
            },
            {
                "tag_name": "tag_01",
                "data": {
                    "MyVal": [1625],
                    "TIME": ["2021-07-06 12:12:25"]
                }
            }
        ]
    }
}