Intervals API Documentation¶
This document provides detailed information about the intervals-related endpoints in the API.
Endpoints¶
1. Create Intervals Table¶
- Endpoint:
POST /createTable - Description: Creates the intervals table in the database if it does not already exist.
- Request Body: None
- Response:
- 200 OK: Table created successfully.
- 500 Internal Server Error: Error occurred while creating the table.
2. Create a New Interval¶
- Endpoint:
POST / - Description: Creates a new interval entry in the database.
- Request Body (JSON):
{ "intervalFeedbackTestApi": number, "intervalDeviceStatus": number, "intervalDeviceStatusEspera": number, "intervalAllDevices": number, "intervalDeviceWatchers": number, "intervalDeviceWatchersTimeout": number, "intervalRefreshToken": number, "intervalDeviceInternalConsult": number, "intervalDeviceSyncInfo": number } - Response:
- 201 Created: Interval created successfully.
- 400 Bad Request: Invalid input data.
- 500 Internal Server Error: Error occurred while creating the interval.
3. Get All Intervals¶
- Endpoint:
GET / - Description: Retrieves all interval entries from the database.
- Request Parameters: None
- Response:
- 200 OK: Returns a JSON array of intervals.
- 500 Internal Server Error: Error occurred while fetching intervals.
4. Get Interval by ID¶
- Endpoint:
GET /:id - Description: Retrieves a specific interval entry by its ID.
- Path Parameter:
id(string): The ID of the interval to retrieve.- Response:
- 200 OK: Returns a JSON object of the interval.
- 404 Not Found: Interval with the specified ID not found.
- 500 Internal Server Error: Error occurred while fetching the interval.
5. Update an Interval¶
- Endpoint:
PUT /:id - Description: Updates a specific interval entry by its ID.
- Path Parameter:
id(string): The ID of the interval to update.- Request Body (JSON):
{ "intervalFeedbackTestApi": number, "intervalDeviceStatus": number, "intervalDeviceStatusEspera": number, "intervalAllDevices": number, "intervalDeviceWatchers": number, "intervalDeviceWatchersTimeout": number, "intervalRefreshToken": number, "intervalDeviceInternalConsult": number, "intervalDeviceSyncInfo": number } - Response:
- 200 OK: Interval updated successfully.
- 400 Bad Request: Invalid input data.
- 404 Not Found: Interval with the specified ID not found.
- 500 Internal Server Error: Error occurred while updating the interval.
6. Delete an Interval¶
- Endpoint:
DELETE /:id - Description: Deletes a specific interval entry by its ID.
- Path Parameter:
id(string): The ID of the interval to delete.- Response:
- 200 OK: Interval deleted successfully.
- 404 Not Found: Interval with the specified ID not found.
- 500 Internal Server Error: Error occurred while deleting the interval.
Notes¶
- Ensure the
x-api-keyheader is included in all requests for authentication. - Refer to the User Guide for additional context on using the API.