Welcome to the API Documentation
This documentation provides information on how to interact with the available endpoints. Choose a tab from the left to learn more about a specific API section.
Endpoints
Retrieve sensor data using GET
This endpoint allows you to retrieve data from specific sensors using GET method.
Parameters:
- token: Your API token for authentication.
- type: To signify this type of request (Value doesn't matter, just presence).
- sensor: The unique ID of the sensor from which you want data.
- limit: The number of data points you wish to retrieve.
- allSensors: Set to "true" if you wish to get a list of all sensor IDs.
Example Requests:
api/v1/api.php?token=YOUR_TOKEN&allSensors=true
api/v1/api.php?token=YOUR_TOKEN&type=bathWater&sensor=27FB2072-31F9-427D-9905-C22306DF47B5&limit=1
Responses:
- 200 OK: Success, returns the requested data in JSON format.
- 400 Bad Request: Missing required parameters.
- 401 Unauthorized: Invalid API token.
- 404 Not Found: No data found for the given sensor ID or no sensors found.
- 500 Internal Server Error: General server error or query error.
Retrieve sensor data using POST
This endpoint allows you to retrieve data from specific sensors using POST method.
Parameters:
- token: Your API token for authentication (sent in request body).
- type: To signify this type of request (Value doesn't matter, just presence).
- sensor: The unique ID of the sensor from which you want data.
- limit: The number of data points you wish to retrieve.
Example Request Body:
{
"token": "YOUR_TOKEN",
"type": bathWater,
"sensor": "27FB2072-31F9-427D-9905-C22306DF47B5",
"limit": 1
}
Responses:
- 200 OK: Success, returns the requested data in JSON format.
- 400 Bad Request: Missing required parameters.
- 401 Unauthorized: Invalid API token.
- 404 Not Found: No data found for the given sensor ID.
- 500 Internal Server Error: General server error or query error.
Endpoints
Retrieve lifebuoy data
This endpoint allows you to retrieve the status and last-known location of a specific lifebuoy.
Parameters:
- token: Your API token for authentication.
- id: The unique ID of the lifebuoy you wish to query.
Example Requests:
/api/v2/lifebuoy?token=YOUR_TOKEN&id=LB12345
Responses:
- 200 OK: Success, returns the requested data in JSON format.
- 400 Bad Request: Missing required parameters.
- 401 Unauthorized: Invalid API token.
- 404 Not Found: No data found for the given lifebuoy ID.
- 500 Internal Server Error: General server error or query error.
Update lifebuoy data using POST
This endpoint allows you to update the status and location of a specific lifebuoy.
Parameters:
- token: Your API token for authentication (sent in request body).
- id: The unique ID of the lifebuoy you wish to update.
- status: The current status of the lifebuoy (e.g., 'active', 'inactive', 'maintenance').
- location: The new location of the lifebuoy.
Example Request Body:
{
"token": "YOUR_TOKEN",
"id": "LB12345",
"status": "active",
"location": "Dock 4"
}
Responses:
- 200 OK: Success, returns a confirmation message.
- 400 Bad Request: Missing required parameters.
- 401 Unauthorized: Invalid API token.
- 404 Not Found: No lifebuoy found with the given ID.
- 500 Internal Server Error: General server error or query error.
Login
Please use the following form to log in to the dashboard: