API Interface

Your current location: Home > Support > API Interface
API Documentation

Getting Started

API Interface Introduction

You can use any standard HTTP client to access the API interface.

Interface Call Sequence

1. Check if there is an accessToken locally and whether it has expired.

2. If there is no accessToken or it has expired, first call the interface to get the tenant ID, then call the user login interface to obtain and save the accessToken.

3. Use the accessToken to call other interfaces.

Global Common Parameters

Global Header Parameters

Authorization (String type, required, format: Bearer accessToken, note the space! For example: Bearer a978be92a02041059cdf1133117*****)

tenant-id (String type, required)

User Login Interface

Interface URL:

POST
 https://www.h-smartlink.com/admin-api/system/auth/login

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/auth/login

Method: POST

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Body Request Parameters:

{
           "username": "*******", // Username (required)
           "password": "*******", // Password (required)   
}

Header Parameters:

"tenant-id": "*******", // Tenant ID (required)

Response Parameters:

{
           "code": 0,   // Error code
           "data": {
               "userId": "177807751047659****",   // User ID
               "accessToken": "c1a3bd99d5734f01af0347e6b0******",   // Access token
               "refreshToken": "4b247c88ddc145a595ffe6d77******",   // Refresh token
               "expiresTime": 17398674*****,   // Expiration time
               "tenantId": "1727173508*****"   // Tenant ID
           },
           "msg": ""   // Error message
}

Get Tenant ID by Username

Interface URL:

GET
https://www.h-smartlink.com/admin-api/system/tenant/get-id-by-username?username=138********

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/tenant/get-id-by-username?username=138********

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
username  String     Yes     Login account

Response Parameters:

{
           "code": 0,   // Error code
           "data": "*************",   // Return data
           "msg": ""   // Error message
}

Get Tenant ID by Domain

Interface URL:

GET
https://www.h-smartlink.com/admin-api/system/tenant/get-id-by-domain?domain=http://holykell.test.com

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/tenant/get-id-by-domain?domain=http://holykell.test.com

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
domain  String     Yes     Domain

Response Parameters:

{
           "code": 0,   // Error code
           "data": "*************",   // Return data
           "msg": ""   // Error message
}

Refresh Token

Interface URL:

POST
https://www.h-smartlink.com/admin-api/system/auth/refresh-token?refreshToken=******

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/auth/refresh-token?refreshToken=******

Method: POST

Host: www.h-smartlink.com

Content-Type: none

cache-Control: no-cache

Request Header Parameters:

Parameter Name   Parameter Type   Required   Description
   tenant-id      String           Yes        Tenant ID

Request Query Parameters:

Parameter Name   Parameter Type   Required   Description
   refreshToken   String           Yes        Refresh Token

Response Parameters:

{
       "code": 0,
       "data": {
           "userId": "177807751047****",
           "accessToken": "60bfdd3639bb46c1ad98*****",
           "refreshToken": "fa504375403b45da92dda9048a1****",
           "expiresTime": 1741849172040,
           "tenantId": "172717350891****"
       },
       "msg": ""
   }

Get Logged-in User Information

Interface URL:

GET
https://www.h-smartlink.com/admin-api/system/user/profile/get

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/user/profile/get

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Response Parameters:

{
           "code": 0,
           "data": {
               "username": "******",   // User account
               "nickname": "ABC",   // User nickname
               "remark": null,   // User remark   
               "deptId": null,
               "postIds": null,
               "email": null,   // User email
               "mobile": "******",   // Mobile number
               "avatar": "https://www.h-smartlink.com:9000/holykell/*******.jpg",   // User avatar
               "apiKey": null,
               "balance": "0.00",   // User balance
               "sms": "96",   // SMS count
               "voice": "0",   // Voice count
               "trafficCard": "0",   // Traffic card count
               "clientId": "8a7a12b5884640d3aa5789dc23*****",   // Client AK
               "secret": "9ba85ff4ebaf4da5bb961fa01e4*****",   // Server SK
               "address": null,   // Contact address
               "master": 0,
               "id": "17780775104765*****",   // User ID
               "status": 0,   // Status
               "loginIp": "120.228.142.76",   // Last login IP
               "loginDate": 1739948792000,   // Last login time
               "createTime": 1712761688000,   // Creation time
               "isPhone": true,   // Whether the phone is bound
               "isEmail": false,   // Whether the email is bound
               "roles": [
                   {
                       "id": "1778306545970417665",
                       "name": "Historical Trajectory"
                   }
               ],
               "dept": null,
               "posts": null,
               "socialUsers": []
           },
           "msg": ""
}

Update User Information

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/system/user/profile/update

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/user/profile/update

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Body Request Parameters:

{
           "nickname": "Taro",   // User nickname
           "email": "holykell@iocoder.cn",   // User email
           "mobile": "15601691300",   // Mobile number
           "sex": "1"   // User gender
}

Response Example:

{
           "code": 0,
           "data": true,
           "msg": ""
}

Update Mobile or Email

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/system/user/profile/updateInfo

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/user/profile/updateInfo

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Body Request Parameters:

{
           "email": "holykell@iocoder.cn",   // User email
           "mobile": "15601691300",   // Mobile number
           "smsCode": "",   // Email verification code
           "type": 1   // 1: Update mobile  2: Update email
}

Response Example:

{
           "code": 1,
           "msg": ""
}

Update User Password

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/system/user/profile/update-password

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/user/profile/update-password

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Body Request Parameters:

{
	       "oldPassword": "123456",   // Old password
	       "newPassword": "654321"   // New password
}

Response Example:

{
	       "code": 1,
	       "msg": ""
}

Update User Account

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/system/user/profile/update-account

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/user/profile/update-account

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Body Request Parameters:

{
	       "oldPassword": "123456",   // Password
	       "newUserName": "654321"   // New account
}

Response Example:

{
	       "code": 1,
	       "msg": ""
}

Get User’s Device Groups and Devices Under the Groups (Excluding Sensor Data)

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/deviceGroup/?search=Power Generation Group&deviceSearchType=1

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/deviceGroup/?search=***&deviceSearchType=1

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
search  String     No     Device group name/device name/serial number
deviceSearchType  Integer     No     Device status: 1 All, 2 Alarm, 3 Offline

Response Example:

{
	       "code": 0,
	       "data": [
	           {
	               "createTime": 1712761688000,   // Creation time
	               "updateTime": 1712761688000,   // Last update time
	               "creator": "1727173511939489793",   // Creator
	               "updater": "1727173511939489793",   // Updater
	               "deleted": false,   // Whether deleted
	               "id": 99,   // Device group ID
	               "userId": "1778077510476599297",   // User ID
	               "groupName": "Default Group",   // Group name
	               "sort": 0,   // Sort order
	               "defaultIs": 1,   // Whether default: 0 No, 1 Yes
	               "leftNumber": 3,   // Left number
	               "rightNumber": 3,   // Right number
	               "groupShow": "3/3",   // Online count/Total count
	               "onlineAndTotal": "3/3",   // Online count/Total count
	               "deviceList": [   // Device list
	                   {
	                       "createTime": 1734320817000,
	                       "updateTime": 1735577991000,
	                       "creator": "1727173511939489793",
	                       "updater": "1727173511939489793",
	                       "deleted": false,
	                       "tenantId": "1727173508915396610",   
	                       "id": 253,
	                       "deviceName": "H2603-4G-EL-1-CS241205-001",
	                       "ezvizeDeviceName": null,
	                       "defaultIs": null,
	                       "devicePic": "https://www.h-smartlink.com:9000/holykell/3737c22d4e0d2b0d684723f2ea066bd044c7dcde4fe9970dcf7b243b8d5fbb09",   // Device image
	                       "groupId": 99,   // Device group ID
	                       "deviceGroupName": null,
	                       "tenantName": null,
	                       "deviceUserId": "1778077510476599297",   // Device owner user ID
	                       "deviceUserName": null,
	                       "serialNumber": "2412180000100000",   // Device serial number
	                       "deviceProtocol": "MQTT_MODBUS",   // Device protocol
	                       "productId": 86,   // Product ID
	                       "timeZone": "UTC+08:00",   // Time zone
	                       "reportCycle": 18000,   // Reporting cycle (seconds)
	                       "placeName": "undefined",   // Location name
	                       "longitude": "112.88673472137623",   // Longitude
	                       "latitude": "28.216580871192235",   // Latitude
	                       "sort": 0,   // Device sort order
	                       "disable": 0,   // Disable status: 0 Not disabled, 1 Disabled
	                       "status": 1,   // Device status: 0 Offline, 1 Online
	                       "report": 1,   // Whether active reporting (0 No, 1 Yes)
	                       "tsl": null,   // Thing model
	                       "setting": "[]",   // Device configuration
	                       "alarm": null,
	                       "qos": "2",   // QoS
	                       "list": null,
	                       "sensorWayList": {
	                           "1": 88.0,
	                           "3": -55.0
	                       },
	                       "allList": null,
	                       "children": null,
	                       "groupName": null
	                   },
	                   {
	                       "createTime": 1720676970000,
	                       "updateTime": 1738802819000,
	                       "creator": "1727173511939489793",
	                       "updater": "1727173511939489793",
	                       "deleted": false,
	                       "tenantId": "1727173508915396610",
	                       "id": 204,
	                       "deviceName": "HK302(7-11)",
	                       "ezvizeDeviceName": null,
	                       "defaultIs": null,
	                       "devicePic": "https://www.h-smartlink.com:9000/holykell/6b5d7b384c821d2309d9bf8432920406c2caa31f60d18187310e2fe3071a9bcb",
	                       "groupId": 99,
	                       "deviceGroupName": null,
	                       "tenantName": null,
	                       "deviceUserId": "1778077510476599297",
	                       "deviceUserName": null,
	                       "serialNumber": "B46EWWW653978K46",
	                       "deviceProtocol": "MQTT",
	                       "productId": 77,
	                       "timeZone": "UTC+08:00",
	                       "reportCycle": 3600,
	                       "placeName": "undefined",
	                       "longitude": "25.223211915739768",
	                       "latitude": "1.023813455054567",
	                       "sort": 0,
	                       "disable": 0,
	                       "status": 1,
	                       "report": 0,
	                       "tsl": "{\"times\":\"2024-07-12 15:07:12\",\"sensorDatas\":[{\"flag\":\"3\",\"sensorId\":184827,\"value\":\"\"},{\"flag\":\"2\",\"sensorId\":184826,\"value\":\"\"},{\"flag\":\"Temp.\",\"sensorId\":184828,\"value\":\"\"},{\"flag\":\"1\",\"sensorId\":184825,\"value\":\"\"}]}",
	                       "setting": "[{\"flag\":\"time\",\"value\":\"10\"}]",
	                       "alarm": null,
	                       "qos": "0",
	                       "list": null,
	                       "sensorWayList": {},
	                       "allList": null,
	                       "children": null,
	                       "groupName": null
	                   },
	                   {
	                       "createTime": 1702965630000,
	                       "updateTime": 1736407353000,
	                       "creator": "1736986134392451073",
	                       "updater": "1736988366602342402",
	                       "deleted": false,
	                       "tenantId": "1727173508915396610",
	                       "id": 47,
	                       "deviceName": "H2603-4G-EL Level Transmitter",
	                       "ezvizeDeviceName": null,
	                       "defaultIs": null,
	                       "devicePic": "https://www.h-smartlink.com:9000/holykell/bd4e0d122edd1855019c0fbf8ccfad33d4be8ee379d9b96243e1e3b51f773ca7.jpg",
	                       "groupId": 99,
	                       "deviceGroupName": null,
	                       "tenantName": null,
	                       "deviceUserId": "1778077510476599297",
	                       "deviceUserName": null,
	                       "serialNumber": "XM5VDZEQHAR581G5",
	                       "deviceProtocol": "MQTT",
	                       "productId": 2,
	                       "timeZone": "UTC+08:00",
	                       "reportCycle": 7200,
	                       "placeName": "undefined",
	                       "longitude": "105.82355594534533",
	                       "latitude": "28.239269696734226",
	                       "sort": 0,
	                       "disable": 0,
	                       "status": 1,
	                       "report": 0,
	                       "tsl": "{\"times\":\"2024-11-26 16:58:33\",\"sensorDatas\":[{\"flag\":\"V\",\"sensorId\":55,\"value\":\"\"},{\"flag\":\"Diesel Level\",\"sensorId\":184676,\"value\":\"\"},{\"flag\":\"ICCID\",\"sensorId\":184557,\"value\":\"\"},{\"flag\":\"F\",\"sensorId\":53,\"value\":\"\"},{\"flag\":\"Open Pump\",\"sensorId\":184755,\"value\":\"\"},{\"flag\":\"Position\",\"sensorId\":184720,\"value\":\"\"},{\"flag\":\"Q\",\"sensorId\":56,\"value\":\"\"},{\"flag\":\"T\",\"sensorId\":54,\"value\":\"\"}]}",
	                       "setting": "[{\"flag\":\"FF\",\"value\":\"1.600\"},{\"flag\":\"BR\",\"value\":\"0\"},{\"flag\":\"CT\",\"value\":\"180\"},{\"flag\":\"FH\",\"value\":\"3.000\"},{\"flag\":\"TF\",\"value\":\"70.000\"},{\"flag\":\"AT\",\"value\":\"60\"},{\"flag\":\"TH\",\"value\":\"70.000\"},{\"flag\":\"FL\",\"value\":\"0.000\"},{\"flag\":\"TL\",\"value\":\"0.000\"},{\"flag\":\"FB\",\"value\":\"0.080\"},{\"flag\":\"TB\",\"value\":\"0.000\"}]",
	                       "alarm": null,
	                       "qos": "0",
	                       "list": null,
	                       "sensorWayList": {
	                           "1": 8.37,
	                           "3": 25.0
	                       },
	                       "allList": null,
	                       "children": null,
	                       "groupName": null
	                   }
	               ]
	           }
	       ],
	       "msg": ""
}

Get Real-time and Historical Sensor Data by Pagination

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/user/sc/real/time/list?sensorId=185043&sensorType=1&serialNumber=********&createTime=[2022-07-01 00:00:00, 2022-07-01 23:59:59]&email=&pageNo=1&pageSize=10

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/user/sc/real/time/list?sensorId=185043&sensorType=1&serialNumber=********&createTime=[2022-07-01 00:00:00, 2022-07-01 23:59:59]&email=&pageNo=1&pageSize=10

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
sensorId  Integer     Yes     Device sensor ID
sensorType  Integer     Yes     Sensor type
serialNumber  String     Yes     Serial number
createTime  Array     Yes     Time range ([First click time, next interface call time])
email  String     No     Email
pageNo  Integer     Yes     Page number, starting from 1
pageSize  Integer     Yes     Number of items per page, maximum value is 100

Response Example:

{
	       "code": 0,
	       "data": [
	           {
	               "id": "lrk8IpUBhI7BwA9H****",
	               "productId": 86,   // Product ID
	               "deviceSerial": "241218000010****",   // Device serial number
	               "sensorId": 185043,   // Sensor ID
	               "name": "Water Level",   // Sensor name
	               "readWriteMark": "Liquid Level",   // Read-write identifier, unique sensor identifier
	               "readWriteStatus": null,   // Read-write status: 0 Read-only, 1 Write-only, 2 Read-write
	               "type": 3,   // Sensor type
	               "decimalPlace": 3,   // Decimal places
	               "unit": "mH2O",   // Unit
	               "picture": null,   // Sensor image
	               "sort": null,   // Sort order
	               "value": 0.3864845,   // Value
	               "content": null,   // Coordinates [Longitude, Latitude]
	               "sensorType": 1,   // Sensor type
	               "longitude": null,   // Longitude
	               "latitude": null,   // Latitude
	               "createTime": 1740034234000,   // Creation time, millisecond timestamp, hardware reporting time
	               "serviceReceptionTime": 1740036163104
	           },
	           {
	               "id": "yLpRI5UBhI7BwA9*****",
	               "productId": 86,
	               "deviceSerial": "241218000010****",
	               "sensorId": 185043,
	               "name": "Water Level",
	               "readWriteMark": "Liquid Level",
	               "readWriteStatus": null,
	               "type": 3,
	               "decimalPlace": 3,
	               "unit": "mH2O",
	               "picture": null,
	               "sort": null,
	               "value": 0.39704928,
	               "content": null,
	               "sensorType": 1,
	               "longitude": null,
	               "latitude": null,
	               "createTime": 1740052153000,
	               "serviceReceptionTime": 1740054294098
	           }
	       ],
	       "msg": ""
}

Get Sensor Data for a Single Device

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/device/sensorListByDevice?serialList=Device Serial Number

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/device/sensorListByDevice?serialList=Device Serial Number

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
serialList  String     Yes     Device serial number ID

Response Example:

{
	           "code": 0,
	           "data": [
	               {
	                   "createTime": 1734320817000,   // Creation time
	                   "updateTime": 1735436137000,   // Last update time
	                   "creator": "1727173511939489793",   
	                   "updater": "1778077510476599297",
	                   "deleted": false,   // Whether deleted
	                   "id": 185045,   // Sensor ID
	                   "deviceId": 253,   // Device ID
	                   "deviceSerial": "2412180000100000",   // Device serial number
	                   "name": "Sensor Name-1",   // Sensor name
	                   "deviceName": "H2603-4G-EL-1-CS241205-001",   // Device name
	                   "volumeCompute": null,   // Volume calculation
	                   "readWriteCmd": "",   // Read-write command
	                   "readWriteMark": "Battery Level",   // Read-write identifier
	                   "readWriteStatus": null,   // Read-write status: 0 Read-only, 1 Write-only, 2 Read-write
	                   "reportType": 2,   // Data reporting mode: 1 Question-Answer, 2 Active reporting
	                   "reportOpen": 0,   // Whether to enable question-answer mode: 1 Enable, 0 Disable
	                   "type": null,   // Sensor value type
	                   "sensorWay": 1,   // Sensor method
	                   "sensorType": 1,   // 1 Numeric, 2 Switch (Operable), 3 Location, 4 Image, 5 Switch (Non-operable), 6 Gear, 7 Video, 8 Character
	                   "upMapping": "{\"input1\":\"\",\"input2\":\"\",\"input3\":\"\",\"input4\":\"\"}",   // Upstream mapping
	                   "downMapping": "{\"input1\":\"\",\"input2\":\"\",\"input3\":\"\",\"input4\":\"\"}",   // Downstream mapping
	                   "linkType": null,   // Connection status: 0 Not connected, 1 Connected
	                   "time": null,   // Update time
	                   "data": null,   // Sensor data
	                   "decimalPlace": 2,   // Decimal places
	                   "unit": "%",   // Unit
	                   "picture": "https://www.h-smartlink.com:9000/holykell/e532e24d880da9429dc2f53676201edcbbe0c426776aec39c7f378ca8df1cc1e.png",   // Sensor image
	                   "alarmStatus": 0,   // Alarm status: 1 Alarm, 0 Normal
	                   "sort": 3,   // Sort order
	                   "regAddr": null,   // Register address
	                   "regType": null,   // Register type
	                   "regNums": null,   // Register count
	                   "step": null,   // Step size
	                   "offset": null   // Offset
	               },
	               {
	                   "createTime": 1734320817000,
	                   "updateTime": 1735436137000,
	                   "creator": "1727173511939489793",
	                   "updater": "1778077510476599297",
	                   "deleted": false,
	                   "id": 185046,
	                   "deviceId": 253,
	                   "deviceSerial": "2412180000100000",
	                   "name": "Sensor Name-2",
	                   "deviceName": "H2603-4G-EL-1-CS241205-001",
	                   "volumeCompute": null,
	                   "readWriteCmd": "",
	                   "readWriteMark": "Signal",
	                   "readWriteStatus": null,
	                   "reportType": 2,
	                   "reportOpen": 0,
	                   "type": null,
	                   "sensorWay": 3,
	                   "sensorType": 1,
	                   "upMapping": "{\"input1\":\"\",\"input2\":\"\",\"input3\":\"\",\"input4\":\"\"}",
	                   "downMapping": "{\"input1\":\"\",\"input2\":\"\",\"input3\":\"\",\"input4\":\"\"}",
	                   "linkType": null,
	                   "time": null,
	                   "data": null,
	                   "decimalPlace": 2,
	                   "unit": "db",
	                   "picture": "https://www.h-smartlink.com:9000/holykell/eac40dd1f4d2e42a284302a6593ab683d05fdc49868c7be39c5d72863f3c5bfc",
	                   "alarmStatus": 0,
	                   "sort": 4,
	                   "regAddr": null,
	                   "regType": null,
	                   "regNums": null,
	                   "step": null,
	                   "offset": null
	               }
	           ],
	           "msg": ""
}

Add Device Group

Interface URL:

POST
https://www.h-smartlink.com/admin-api/business/deviceGroup?deviceGroupName=Group1

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/deviceGroup?deviceGroupName=Group1

Method: POST

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	"deviceGroupName": "Group1"
}

Response Example:

{
	"code": 1,
	"msg": ""
}

Update Device Group

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/business/deviceGroup?deviceGroupName=Group1&id=1

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/deviceGroup?deviceGroupName=Group1&id=1

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
  "deviceGroupName": "Power Generation Group",
  "id": "1"
}

Response Example:

{
	"code": 1,
	"msg": ""
}

Delete Device Group

Interface URL:

DELETE
https://www.h-smartlink.com/admin-api/business/deviceGroup?id=1

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/deviceGroup?id=1

Method: DELETE

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
id  Integer     Yes     Device group ID

Response Example:

{
	"code": 0,
	"data": true,
	"msg": ""
}

Device Thing Model (Configure Protocol, Read-Write Commands)

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/device/tsl?deviceSerialNumber=DeviceSerial

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/device/tsl?deviceSerialNumber=DeviceSerial

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
deviceSerialNumber  String     Yes     Device serial number

Response Example:

{
	       "code": 0,
	       "data": {
	           "times": "2025-02-24 11:25:46",
	           "sensorDatas": [
	               {
	                   "sensorId": 184827,
	                   "flag": "3",
	                   "value": ""
	               },
	               {
	                   "sensorId": 184825,
	                   "flag": "1",
	                   "value": ""
	               },
	               {
	                   "sensorId": 184826,
	                   "flag": "2",
	                   "value": ""
	               },
	               {
	                   "sensorId": 184828,
	                   "flag": "Temp.",
	                   "value": ""
	               }
	           ]
	       },
	       "msg": ""
}

Update Device Thing Model (Configure Protocol, Read-Write Identifier)

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/business/device/sensor/readWriteMark

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/device/sensor/readWriteMark

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	"sensorId": "Power Generation Group",     // Sensor ID
	"readWriteMark": "ABC"   // Sensor read-write identifier
}

Response Example:

{
	"code": 1,
	"msg": ""
}

Parameter Configuration

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/business/device/params/settings

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/device/params/settings

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	"deviceSerialNumber": "SerialNumber",   // Device serial number
	"params": "[{"flag":"time","value":"10"}]",   // Parameter configuration (JSON format)
	"qos": "0",   // QoS: 0, 1, 2 (required if type = 1)
	"type": "1"   // Operation type: 1 Send to device, 2 Save configuration parameters
}

Response Example:

{
	"code": 1,
	"msg": ""
}

Send Command

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/user/sc/issue/order?sensorId=1&content=28.3

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/user/sc/issue/order?sensorId=1&content=28.3

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
sensorId  Integer     Yes     Device sensor ID
content  String     Yes     Command content

Response Example:

{
	"code": 1,
	"msg": ""
}

Sensor Value Statistics (Min, Max, Avg, Sum, Diff)

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/user/sc/real/time/group?sensorId=1&sensorType=1&serialNumber=&createTime=[2022-07-01 00:00:00, 2022-07-01 23:59:59]&pageNo=1&pageSize=10

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/user/sc/real/time/group?sensorId=1&sensorType=1&serialNumber=&createTime=[2022-07-01 00:00:00, 2022-07-01 23:59:59]&pageNo=1&pageSize=10

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
sensorId  Integer     Yes     Device sensor ID
sensorType  Integer     Yes     Type
serialNumber  String    Yes    Serial number
createTime   Array   Yes    Time range ([First click time, next interface call time])
pageNo    Integer   Yes   Page number, starting from 1
pageSize   Integer   Yes   Number of items per page, maximum value is 100

Response Example:

{
	       "code": 1,
	       "data": {
	           "max": 1,   // Maximum value
	           "min": 1,   // Minimum value
	           "avg": 1,   // Average value
	           "sum": 1,   // Sum value
	           "diff": 1   // Difference value
	       },
	       "msg": ""
}

Count Alarms and Offline Devices (alarm: alarms, Offline: offline devices)

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/user/sc/state

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/user/sc/state

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Response Example:

{
	"code": 0,
	"data": {
	    "alarm": 0,   // Number of alarms
	    "Offline": 5   // Number of offline devices
	},
	"msg": ""       
}

Create Trigger

Interface URL:

POST
https://www.h-smartlink.com/admin-api/business/alarmTrigger/

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/alarmTrigger

Method: POST

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	       "sensorIdList": [   // Sensor ID list
	           185111
	       ],
	       "alarmLanguage": 2,   // Alarm language: 1 Chinese, 2 English
	       "isForward": 0,   // Whether to forward: 1 Yes, 0 No
	       "forwardDeviceSerial": null,   // Forward device serial number (required if forwarding)
	       "forwardSensorId": null,   // Forward sensor ID (required if forwarding)
	       "forwardContent": null,   // Forward content (required if forwarding)
	       "notifySleep": "600",   // Notification interval (in seconds)
	       "conditionVoList": [   // Trigger condition list
	           {
	               "conditionCode": "GT_X",   // Condition code
	               "conditionParams": {   // Condition parameters
	                   "X": "140",
	                   "Y": "",
	                   "M": ""
	               },
	               "notifyTemplateId": "1752579862541996033",   // Notification template ID
	               "status": 1   // Whether enabled: 1 Yes, 0 No
	           }
	       ],
	       "alarmTriggerContactList": [
	           {
	               "id": null,
	               "triggerId": null,   // Trigger ID (optional for editing)
	               "contactId": 20,   // Contact ID
	               "notifyChannel": "SMS"   // Notification channel (multiple channels separated by commas)
	           }
	       ]
}

Response Example:

{
	 "code": 0,
	 "data": true,
	 "msg": ""      
}

Edit Trigger

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/business/alarmTrigger

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/alarmTrigger

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	       "sensorIdList": [   // Sensor ID list
	           185111
	       ],
	       "alarmLanguage": 2,   // Alarm language: 1 Chinese, 2 English
	       "isForward": 0,   // Whether to forward: 1 Yes, 0 No
	       "forwardDeviceSerial": null,   // Forward device serial number (required if forwarding)
	       "forwardSensorId": null,   // Forward sensor ID (required if forwarding)
	       "forwardContent": null,   // Forward content (required if forwarding)
	       "notifySleep": "600",   // Notification interval (in seconds)
	       "conditionVoList": [   // Trigger condition list
	           {
	               "conditionCode": "GT_X",   // Condition code
	               "conditionParams": {   // Condition parameters
	                   "X": "140",
	                   "Y": "",
	                   "M": ""
	               },
	               "notifyTemplateId": "1752579862541996033",   // Notification template ID
	               "status": 1   // Whether enabled: 1 Yes, 0 No
	           }
	       ],
	       "alarmTriggerContactList": [
	           {
	               "id": null,
	               "triggerId": null,   // Trigger ID (optional for editing)
	               "contactId": 20,   // Contact ID
	               "notifyChannel": "SMS"   // Notification channel (multiple channels separated by commas)
	           }
	       ]
}

Response Example:

{
	  "code": 0,
	  "data": true,
	  "msg": ""     
}

Trigger Switch

Interface URL:

POST
https://www.h-smartlink.com/admin-api/business/alarmTrigger/set/status

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/alarmTrigger/set/status

Method: POST

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	"triggerId": 1,   // Trigger ID
	"status": 1   // 1 Enable, 0 Disable
}

Response Example:

{
	"code": 0,
	"data": true,
	"msg": ""       
}

Get Trigger List by Pagination

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/alarmTrigger/?sensorId=&deviceSerial=&status=1&condition=&contactName=&pageNo=1&pageSize=10

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/alarmTrigger/?sensorId=&deviceSerial=&status=1&condition=&contactName=&pageNo=1&pageSize=10

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
sensorId  String     Yes     Sensor ID
deviceSerial  String     Yes     Device serial number
status  Integer    No    Trigger status
condition   String   No    Trigger condition
contactName  String   No   Contact name
pageNo    Integer   Yes   Page number, starting from 1
pageSize   Integer   Yes   Number of items per page, maximum value is 100	   

Response Example:

{
	       "code": 1,
	       "data": {
	           "list": [
	               {
	                   "triggerConditionDesc": "",
	                   "triggerConditionI18nDesc": "",   // Trigger condition
	                   "contactListStr": "",   // Contacts
	                   "notifyChannelStr": "",   // Notification method
	                   "forwardDeviceName": "",   // Forward device name
	                   "forwardSensorName": "",   // Forward sensor name
	                   "alarmTriggerContactList": [   // Alarm contacts
	                       {
	                           "contacts": {   // Contact details
	                               "id": 1,
	                               "name": "",   // Contact name
	                               "userId": 1,   // User ID
	                               "phoneNumber": "",   // Phone number
	                               "email": "",   // Email
	                               "wechat": "",   // WeChat
	                               "createTime": "2024-12-02 17:18:49",   // Creation time
	                               "updateTime": "2024-12-02 17:18:49",   // Last update time
	                               "creator": "",
	                               "updater": "",
	                               "deleted": true   // Whether deleted
	                           },
	                           "id": 1,
	                           "triggerId": 1,   // Trigger ID
	                           "contactId": 1,   // Contact ID
	                           "notifyChannel": ""   // Notification channel (multiple channels separated by commas)
	                       }
	                   ],
	                   "id": 1,
	                   "deviceSerial": "",   // Device serial number
	                   "sensorId": 1,   // Sensor ID
	                   "conditionCode": "",   // Condition code
	                   "conditionName": "",   // Condition description
	                   "conditionParams": "",   // Condition parameters
	                   "notifyTemplateId": 1,   // Notification template ID
	                   "notifySleep": 1,   // Notification interval (in seconds)
	                   "status": 1,   // Whether enabled: 1 Yes, 0 No
	                   "alarmLanguage": 1,   // Alarm language: 1 Chinese, 2 English
	                   "isForward": 1,   // Whether to forward: 1 Yes, 0 No
	                   "forwardDeviceSerial": "",   // Forward device serial number
	                   "forwardSensorId": 1,   // Forward sensor ID
	                   "forwardContent": "",   // Forward content
	                   "createTime": "2024-12-02 17:18:49",
	                   "updateTime": "2024-12-02 17:18:49",
	                   "creator": "",
	                   "updater": "",
	                   "deleted": true   // Whether deleted
	               }
	           ],
	           "total": 1   // Total count
	       },
	       "msg": ""
}

Delete Trigger

Interface URL:

DELETE
https://www.h-smartlink.com/admin-api/business/alarmTrigger

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/alarmTrigger

Method: DELETE

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

[
	"1893927371418996737"   // Trigger ID (Array)
]

Response Example:

{
	  "code": 0,
	  "data": true,
	  "msg": ""     
}

Send SMS Verification Code – General Interface

Interface URL:

POST
https://www.h-smartlink.com/admin-api/system/security/send-sms-code

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/security/send-sms-code

Method: POST

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	       "contact": "104206034@qq.com",    // Phone number or email
	       "scene": "31"   // Usage scenario (31: Chinese registration, 32: English registration), 41: Password recovery
}

Response Example:

{
	"code": 0,
	"data": true,
	"msg": ""       
}

Send Email Verification Code – General Interface

Interface URL:

POST
https://www.h-smartlink.com/admin-api/system/security/send-mail-code-t

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/system/security/send-mail-code-t

Method: POST

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	       "mail": "7685413@qq.com",   // Recipient email
	       "templateCode": "admin-registry-verify-code-english (English template), admin-registry-verify-code (Chinese template)",   // Template code
	       "templateParams": {   // Template parameters (optional)
	           "KEY": {
	           }
	       }
}

Response Example:

{
	"code": 0,
	"data": true,
	"msg": ""       
}

Alarm Record Pagination

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/alarmRecord?pageNo=1&pageSize=10

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/alarmRecord?pageNo=1&pageSize=10

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
keyword  String     No     Search keyword
sensorId  Integer     No     Sensor ID
channel  String    No    Alarm method
sendStatus   String   No    Send status: 1 Success, 0 Failure
timeZone  String   No   Time zone
createTime  Array   No   Alarm time ([2022-07-01 00:00:00, 2022-07-01 23:59:59])
pageNo    Integer   Yes   Page number, starting from 1
pageSize   Integer   Yes   Number of items per page, maximum value is 100

Response Example:

{
	       "code": 0,
	       "data": {
	           "list": [
	               {
	                   "id": "1849368732767457281",   // Sensor ID
	                   "triggerId": "1849367234243301378",   
	                   "deviceSerial": "Device Serial Number****",
	                   "deviceName": "Device Name*****",
	                   "sensorId": 184826,   // Sensor ID
	                   "sensorName": "HR2000",   // Sensor name
	                   "channel": "Email,SMS",   // Alarm method
	                   "alarmTime": 1729758834000,   // Alarm time
	                   "triggerValue": "4.0 mA",   // Trigger value
	                   "sendStatus": 1,   // Send status: 1 Success, 0 Failure
	                   "alarmContent": "device: Device Name***** sensor: HR2000 trigger: 1.0 currentVal: 4.0",   // Alarm content
	                   "failCause": null,   // Failure reason
	                   "userId": "1778077510476599297",   // User ID
	                   "tenantId": "1727173508915396610",   // Tenant ID
	                   "contactsList": [   // Contact details list
	                       {
	                           "createTime": 1729758765000,
	                           "updateTime": 1729758765000,
	                           "creator": "1778077510476599297",
	                           "updater": "1778077510476599297",
	                           "deleted": false,  // Whether deleted
	                           "id": 23,
	                           "name": "Alarm1",   // Contact name
	                           "userId": "1778077510476599297",   // User ID
	                           "phoneNumber": "17307411256",   // Phone number
	                           "email": "magic@holykell.com",   // Email
	                           "wechat": null
	                       }
	                   ],
	                   "deviceSensor": null,   // Sensor
	                   "alarmTriggerConditionDesc": "Above 1.0",   // Trigger condition
	                   "alarmTriggerConditionI18nDesc": "GT_1.0",   // Trigger condition
	                   "channelName": "Email,SMS"
	               }
	           ],
	           "total": 454
	       },
	       "msg": ""
}

Contact List

Interface URL:

GET
https://www.h-smartlink.com/admin-api/business/contacts/?name=&phoneNumber=&email=&pageNo=1&pageSize=10

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/contacts/?name=&phoneNumber=&email=&pageNo=1&pageSize=10

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
name  String     No     Contact name
phoneNumber  String     No     Phone number
email  String    No    Email
pageNo    Integer   Yes   Page number, starting from 1
pageSize   Integer   Yes   Number of items per page, maximum value is 100

Response Example:

{
	       "code": 1,
	       "data": {
	           "list": [
	               {
	                   "id": 1,
	                   "name": "",   // Contact name
	                   "userId": 1,   // User ID
	                   "phoneNumber": "",   // Phone number
	                   "email": "",   // Email
	                   "wechat": "",   // WeChat
	                   "createTime": "2024-12-02 17:18:50",   // Creation time
	                   "updateTime": "2024-12-02 17:18:50",   // Last update time
	                   "creator": "",
	                   "updater": "",
	                   "deleted": true   // Whether deleted
	               }
	           ],
	           "total": 1   // Total count
	       },
	       "msg": ""
}

Add Contact

Interface URL:

POST
https://www.h-smartlink.com/admin-api/business/contacts/

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/contacts

Method: POST

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	"id": 1,  // Contact primary key
	"name": "",   // Contact name
	"userId": 1,   // User ID
	"phoneNumber": "",   // Phone number
	"email": "",   // Email
	"smsCode": "",   // SMS verification code (required)
	"mailCode": "",   // Email verification code (required)
	"templateCode": "",   // SMS template
	"type": 1   // 1: App addition, 2: Backend addition       
}

Response Example:

{
	"code": 0,
	"data": true,
	"msg": ""       
}

Update Contact

Interface URL:

PUT
https://www.h-smartlink.com/admin-api/business/contacts/

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/contacts

Method: PUT

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

{
	 "id": 1,   // Contact primary key
	 "name": "",   // Contact name
	 "userId": 1,   // User ID
	 "phoneNumber": "",   // Phone number
	 "email": "",   // Email
	 "smsCode": "",   // SMS verification code (required)
	 "mailCode": "",   // Email verification code (required)
	 "templateCode": "",   // SMS template
	 "type": 1   // 1: App addition, 2: Backend addition      
}

Response Example:

{
	"code": 0,
	"data": true,
	"msg": ""       
}

Delete Contact

Interface URL:

DELETE
https://www.h-smartlink.com/admin-api/business/contacts/

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/business/contacts

Method: DELETE

Host: www.h-smartlink.com

Content-Type: application/json

cache-control: no-cache

Authentication: Inherit from parent

Request Body Parameters:

[
	// Array
]

Response Example:

{
	"code": 0,
	"data": true,
	"msg": ""       
}

Get Scheduled Task List by Pagination

Interface URL:

GET
https://www.h-smartlink.com/admin-api/infra/job/page?pageNo=1&pageSize=10&jobType=2&userId=*********

Request Description:

Interface URL: https://www.h-smartlink.com/admin-api/infra/job/page?pageNo=1&pageSize=10&jobType=2&userId=*********

Method: GET

Host: www.h-smartlink.com

Content-Type: none

cache-control: no-cache

Authentication: Inherit from parent

Request Query Parameters:

Parameter Name   Parameter Type   Required   Parameter Description
jobType  Integer     Yes     
userId  String     Yes     User ID
pageNo    Integer   Yes   Page number, starting from 1
pageSize   Integer   Yes   Number of items per page, maximum value is 100

Response Example:

{
	       "code": 0,
	       "data": {
	           "list": [
	               {
	                   "name": "HR2000",
	                   "handlerParam": "204,184826,0,0,1,MQTT",
	                   "cronExpression": "0 30 */1 ? * *",
	                   "retryCount": 0,
	                   "retryInterval": 0,
	                   "monitorTimeout": 0,
	                   "deviceId": 204,
	                   "sensorId": 184826,
	                   "sensorName": null,
	                   "isTransfer": 0,
	                   "sendData": "1",
	                   "transferDevice": null,
	                   "transferSensor": null,
	                   "cornDescription": "Execute once",
	                   "agreement": "MQTT",
	                   "jobType": 2,
	                   "id": 91,
	                   "status": 1,
	                   "handlerName": "sensorHandle616883",
	                   "createTime": 1726093639000,
	                   "week": "{\"week\":\"5,2,3,4,6,7,1\",\"type\":1,\"hour\":1,\"minute\":30,\"second\":0}"
	               },
	               {
	                   "name": "Battery",
	                   "handlerParam": "174,184631,0,0,1,MQTT",
	                   "cronExpression": "6 2 3 ? * *",
	                   "retryCount": 0,
	                   "retryInterval": 0,
	                   "monitorTimeout": 0,
	                   "deviceId": 174,
	                   "sensorId": 184631,
	                   "sensorName": null,
	                   "isTransfer": 0,
	                   "sendData": "1",
	                   "transferDevice": null,
	                   "transferSensor": null,
	                   "cornDescription": "Execute once",
	                   "agreement": "MQTT",
	                   "jobType": 2,
	                   "id": 89,
	                   "status": 1,
	                   "handlerName": "sensorHandle812832",
	                   "createTime": 1718220879000,
	                   "week": "{\"week\":\"3\",\"type\":3,\"hour\":3,\"minute\":2,\"second\":6}"
	               }
	           ],
	           "total": 2
	       },
	       "msg": ""
}

Ask an Expert