Open API


The Open API node uses an EnOS open API to access resources within EnOS. For more information about EnOS open API, see About EnOS API.

Node Type

Action.

Input and Output Ability

This node has multiple entry points and 1 exit point. The input can be any format.


The output is data in JSON format returned from the API.


Node Properties

../../_images/open_api.png


Name

The name for this node.


Request

The request method this node uses to request API. Supports GET, POST, DELETE, and PATCH.


API URL

The URL to access the API. Supports expressions ${msg.XXX} to get the URL from the input msg.


AccessKey

The access key of the API.


SecretKey

The secret key of the API.


Params

The parameters attached to the URL of the request in the form of “?key=value”.


Body

When selecting POST or PATCH for Request, you can enter data here. While the data can be in any format, it is usually in JSON. The API will return data based on the parameters entered and display it in the output msg.


Timeout

The request timeout of this node. The unit is in seconds and the default value is 30. If this node does not receive any response from the server within this period, this request will timeout. The minimum timeout is 1 second.


Description

The description for this node.


Samples

Input Sample

{
    "externalId":"externalId",
    "timestamp":24214324324,
    "measurepoints":{
        "speed":32,
        "heat":40
    }
}


Supposing the Open API node that searches for the information about connected devices has the following configurations:

Field

Value

Name

Open API

Request

GET

API URL

https://ag-cn5.envisioniot.com/connect-service/v2.1/devices

Params

action: search
orgId: o15475450989191
assetId: NhrKJecm

Timeout

10


Then it is equivalent to making an request as follows:

GET https://ag-cn5.envisioniot.com/connect-service/v2.1/devices?action=search&orgId=o15475450989191&assetId=NhrKJecm


Output Sample

{
  "MetaData": {},
  "Body": {
    "code": 0,
    "msg": "OK",
    "requestId": "c8c79cfe-6a54-496f-8f91-61bea3c97a53",
    "data": [
      {
        "orgId": "o15475450989191",
        "assetId": "pH125j6p",
        "modelId": "sq0329",
        "modelIdPath": "/sq0329",
        "productKey": "9z7q93kR",
        "productName": {
          "defaultValue": "sq0329",
          "i18nValue": {}
        },
        "productType": "Device",
        "dataFormat": "Json",
        "deviceKey": "v8lpJN2bwu",
        "deviceName": {
          "defaultValue": "device01",
          "i18nValue": {}
        },
        "deviceSecret": "DeviceSecretDemo1",
        "deviceDesc": "",
        "timezone": "+08:00",
        "deviceAttributes": {},
        "deviceTags": {},
        "mirrorSource": null,
        "firmwareVersion": null,
        "createTime": 1649668259178,
        "status": "online",
        "activeTime": 1649668289281,
        "lastOnlineTime": 1649670014408,
        "lastOfflineTime": 1649669913216,
        "measurepointLastUpdate": null,
        "eventLastUpdate": null,
        "attributeLastUpdate": null,
        "featureLastUpdate": null
      }
    ],
    "pagination": {
      "sortedBy": null,
      "pageNo": 1,
      "pageSize": 1,
      "totalSize": 100
    }
  }
}