queryApi - n1lby73/industrial-IOT GitHub Wiki

Overview

The Query API is exclusively designed for microcontroller integration, facilitating the retrieval of switch states based on specified PINs from the database.

Endpoint URL

  • URL: https://industrialiot.onrender.com/api/query
  • Method:POST

Request Parameters

  • Headers:

    • Content-Type: application/json
  • Body Parameters:
Parameter Type Description
pin String PIN for switch querying (required)

Responses

  • 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 or 1 indicating ON.
  • Error Responses:

    • Status Code: 404 NOT FOUND
      • Response Body:
        {
          "error": "invalid pin"
        }
      • Description: Indicates that the device specified by the pin was not found.

Usage

  1. Request Method: POST
  2. Endpoint URL: https://industrialiot.onrender.com/api/query
  3. Header: Content-Type: application/json
  4. Request Body:
    {
      "pin": "<device pin>"
    }

Additional Information

For details on consumed pins and functions, check here.

⚠️ **GitHub.com Fallback** ⚠️