Skip to main content

Gateway

Definition

Gateway Type
gateway.json
{
"id": 0,
"farmID": 0,
"zoneID": 0,
"groupID": 0,
"nodeKey": 0,
"typeID": 0,
"gatewayName": "",
"serialNumber": "",
"lat": 0,
"lng": 0,
"power": 0,
"rssi": 0,
"iccid": "",
"topic": "",
"username": "",
"password": "",
"clientID": "",
"status": 0,
"createdAt": "",
"updatedAt": "",
}

Get Gateways

curl -X GET "https://${baseUrl}/gateway/?\$filter=&\$orderBy=&\$page=1&\$pageSize=10" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Gateway

curl -X GET "https://${baseUrl}/gateway/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Apply Gateway.ID

curl -X POST "https://${baseUrl}/apply/gateway/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Create Gateway

curl -X POST "https://${baseUrl}/gateway/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @gateway.json
info
gateway.json
{
"farmID": 0,
"zoneID": 0,
"groupID": 0,
"nodeKey": 0,
"typeID": 0,
"gatewayName": "",
"serialNumber": "",
"lat": 0,
"lng": 0,
"power": 0,
"rssi": 0,
"iccid": "",
"topic": "",
"username": "",
"password": "",
"clientID": "",
"status": 0,
}
tip

success status: 201

Update Gateway

curl -X PUT "https://${baseUrl}/gateway/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @gateway.json
info
gateway.json
{
"farmID": 0,
"zoneID": 0,
"groupID": 0,
"nodeKey": 0,
"typeID": 0,
"gatewayName": "",
"serialNumber": "",
"lat": 0,
"lng": 0,
"power": 0,
"rssi": 0,
"iccid": "",
"topic": "",
"username": "",
"password": "",
"clientID": "",
"status": 0,
}

Update Gateway Partial

curl -X PATCH "https://${baseUrl}/gateway/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: farmID,zoneID,groupID,nodeKey,typeID,gatewayName,serialNumber,lat,lng,power,rssi,iccid,topic,username,password,clientID,status" \
-d @gateway.json
info
gateway.json
{
"farmID": 0,
"zoneID": 0,
"groupID": 0,
"nodeKey": 0,
"typeID": 0,
"gatewayName": "",
"serialNumber": "",
"lat": 0,
"lng": 0,
"power": 0,
"rssi": 0,
"iccid": "",
"topic": "",
"username": "",
"password": "",
"clientID": "",
"status": 0,
}

Update Gateway Status

curl -X PATCH "https://${baseUrl}/gateway/${id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @gateway.json
info
gateway.json
{
"status": 0
}

Destroy Gateway

curl -X DELETE "https://${baseUrl}/gateway/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"