Query Latest Measurement Point


Get the latest readings of measurement points by point IDs.

Request Format


GET/POST https://{api-gateway}/cds-realtime-service/v1.0/measurement-point/latest?action=query

Request Parameters


Name Location Mandatory/Optional Data Type Description
orgId Query Mandatory String The organization ID which the measurement point belongs to. How to get orgId >>
mdmIds Query/Form Mandatory String The object instance ID which the measurement point belongs to. Separate multiple IDs by commas. Up to 20000 object instances are allowed in a single query. To ensure query performance, it is recommended that you pass in no more than 100 object instances in a single query.
pointIds Query/Form Mandatory String The measurement point ID. Separate multiple IDs by commas. Up to 100 points are allowed in a single query. How to get pointId>>
mdmTypes Query/Form Optional Boolean Specify how to filter the returned data by the object type that a child asset belongs to. Support specifying only one object type identifier. How to get mdmTypes>>
filter Query/Form Optional String Specify how to filter the returned data by pointIds and attributes. If you specify the field that comes from attributes, the prefix A:: is required, otherwise the field come from pointIds by default. For example, [[{“field”:”A::field1”,”operator”:”>=”,”value”:”1”},{“field”:”A::field2”,”operator”:”<=”,”value”:”2”}],[{“field”:”field3”,”operator”:”==”,”value”:”3”}]], which means the returned data is filtered by (field1 >= 1 and field2 <= 2) or (field3=3), among where field1 and field1 come from attributes, field3 comes from pointIds.
orderBy Query/Form Optional String Specify how to sort the returned data by pointIds and attributes. If you specify the field that comes from attributes, the prefix A:: is required, otherwise the field come from pointIds by default. For example, [{“field”:”A::field1”,”order”:”ASC”}, {“field”:”field2”,”order”:”DESC”}], which means the returned data is sorted first by field1 in ascending order and then by field2 in descending order, among where field1 comes from attributes, field2 comes from pointIds.
pageSize Query/Form Optional Integer The number of the returned records on a single page. The maximum number is 20000.
pageNo Query/Form Optional Integer The number of page to be returned, starting from 1.

Response Content Type


application/json; charset = UTF-8

Response Parameters


Name To Return Definitely/Conditionally Data Type Description
data Definitely PointValue Struct Describe the details of the point. See PointValue Struct.
pagination Definitely Pagination Struct Describe the pagination information. See Pagination Struct.

PointValue Struct


Name To Return Definitely/Conditionally Data Type Description
value Definitely Integer/Double/String The value of the measurement point.
timestamp Definitely Long The latest data timestamp (UNIX time).
localtime Definitely String The latest data timestamp in local time format.
attributes Conditionally Object Describe the attributes of the measurement point.

Pagination Struct


Name To Return Definitely/Conditionally Data Type Description
pageNo Definitely Integer The number of page to be returned, starting from 1.
pageSize Definitely Integer The number of the returned records on a single page.
totalSize Definitely Integer The total number of the returned records.

Samples

Request Sample


GET https://{api-gateway}/cds-realtime-service/v1.0/measurement-point/latest?action=query&orgId=yourOrgId&mdmIds=yourMdmId&pointIds=yourPointId

Response Sample


{
    "data": {
        "yourMdmId": {
            "points": {
                "SITE.a": {
                    "value": 0,
                    "timestamp": 1572430440009,
                    "localtime":"2020-03-31T23:59:59",
                    "attributes": {}
                },
                "SITE.b": {
                    "value": 29,
                    "timestamp": 1572430440009,
                    "localtime":"2020-03-31T23:59:59",
                    "attributes": {}
                },
                "SITE.c": {
                    "value": 282720,
                    "timestamp": 1572430440009,
                    "localtime":"2020-03-31T23:59:59",
                    "attributes": {}
                }
            }
        }
    },
    "code": 0,
    "msg": "OK",
    "traceId": "1234567890abcdefghijkl0987654321"
}