-
Notifications
You must be signed in to change notification settings - Fork 4
queryApi
n1lby73 edited this page Feb 12, 2024
·
7 revisions
The Query API is exclusively designed for microcontroller integration, facilitating the retrieval of switch states based on specified PINs from the database.
-
URL:
https://industrialiot.onrender.com/api/query
-
Method:
POST
-
Headers:
-
Content-Type:
application/json
-
Content-Type:
- Body Parameters:
Parameter | Type | Description |
---|---|---|
pin |
String | PIN for switch querying (required) |
-
Success Response:
- Status Code: 200 OK
-
Response Body:
{ "success": "<STATE>", }
-
Description: Returns the state of the device specified by the provided pin either
0
indicating OFF or1
indicating ON.
-
Description: Returns the state of the device specified by the provided pin either
-
Error Responses:
-
Status Code: 404 NOT FOUND
-
Response Body:
{ "error": "invalid pin" }
- Description: Indicates that the device specified by the pin was not found.
-
Response Body:
-
Status Code: 404 NOT FOUND
-
Request Method:
POST
-
Endpoint URL:
https://industrialiot.onrender.com/api/query
-
Header:
Content-Type: application/json
-
Request Body:
{ "pin": "<device pin>" }
For details on consumed pins and functions, check here.