-
Notifications
You must be signed in to change notification settings - Fork 4
pinStatusApi
n1lby73 edited this page Feb 12, 2024
·
6 revisions
The Pin Status API endpoint retrieves and returns the current state of a microcontroller pin form the database. It requires authentication through a JSON Web Token (JWT) and provides information about the status of the specified pin.
-
URL:
https://industrialiot.onrender.com/api/status
-
Method:
POST
-
Headers:
-
Authorization:
Bearer <ACCESS_TOKEN>
-
Content-Type:
application/json
-
Authorization:
Parameter | Type | Description |
---|---|---|
pin |
Integer | Pin number (required) |
-
Success Response:
- Status Code: 200 OK
-
Response Body:
{ "motor state": "<PIN_STATE>" }
- Description: Indicates the state of the specified pin retrieved successfully.
-
Error Responses:
-
Status Code: 400 Bad Request
-
Response Body:
{ "error": "invalid pin" }
- Description: Indicates an invalid or unrecognized pin number provided.
-
Response Body:
-
Status Code: 503 service unavailable
-
Response Body:
{ "Alert": "ESP is offline. Current state unknown" }
- Description: Indicates that the ESP is offline, and the current state of the device is unknown.
-
-
Request Method:
POST
-
Endpoint URL:
https://industrialiot.onrender.com/api/status
-
Header:
Authorization: Bearer <JWT> Content-Type: application/json
-
Request Body:
{ "pin": 26 }
- For details on consumed pins and functions, check here.
- For more error message and causes, check here.