RESTApi for Modbus IO

RESTApi for Modbus IO

การใช้งาน RESTApi สำหรับอุปกรณ์ Modbus IO

การอ่านสถานะต่างๆ ของบอร์ด Modbus IO

🔗 [GET] https://api.honey.co.th/devices/:serial_number

Path Parameters

Name
Type
Description

:serial_number *

string

Device Serial Number

Query Parameters ( option )

Name
Type
Description

apikey

string

API Key (สามารถดูได้จากหน้า HONEYConsole)

Headers Parameters ( option )

Name
Type
Description

apikey

string

API Key (สามารถดูได้จากหน้า HONEYConsole)

Example Request

#️⃣ curl 'https://api.honey.co.th/devices/:serial_number?apikey=:apikey'

Response Success ( 200 : OK )

Response Unauthorized ( 401 : Unauthorized )


การสั่งงานสถานะต่างๆ ของบอร์ด Modbus IO

🔗 [POST] https://api.honey.co.th/devices/:serial_number

Path Parameters

Name
Type
Description

:serial_number *

string

Device Serial Number

Query Parameters ( option )

Name
Type
Description

apikey

string

API Key (สามารถดูได้จากหน้า HONEYConsole)

Headers Parameters ( option )

Name
Type
Description

apikey

string

API Key (สามารถดูได้จากหน้า HONEYConsole)

Request Body

Name
Type
Description

VAR_Y0

bool

ควบคุม Y0 ให้เปิด / ปิด

VAR_Y(n)

bool

ควบคุม Y ที่ n ให้เปิด / ปิด เช่น ต้องการควบคุม Y7 จะต้อง key เป็น VAR_Y7 เป็นต้น

Example Request

#️⃣ curl 'https://api.honey.co.th/devices/:serial_number?apikey=:apikey' \ --header 'Content-Type: application/json' \ --data '{ "VAR_Y0":1 }'

Response Success ( 201 : Created )

Response Unauthorized ( 401 : Unauthorized )

Last updated