Skip to content

Schedules

Data Schema

Field Type Description
id integer Maintenance record ID
name string Maintenance name
type string Type of maintenance
start integer Start time in timestamp format
period integer Maintenance period in days or hours
attributes object Additional maintenance attributes

Fetch Schedules

Retrieves schedules based on specified filters and parameters.

🛠 Endpoint:

GET /maintenance

Authorization:

Supports both:

  • Basic Authentication (basicAuth)
  • Cookie Authentication (session cookie)

Query Parameters:

Parameter Type Description
all boolean If true, fetches all maintenance records (admin only)
userId integer Filter by user ID (for user's own records)
deviceId integer Filter by device ID (requires device access)
groupId integer Filter by group ID (requires group access)
refresh boolean Refresh maintenance data

cURL Examples:

Basic Authentication:

curl -u username:password -X GET "https://itsochvts.com/api/maintenance" \
-H "Content-Type: application/json"

Cookie Authentication:

curl -X GET "https://itsochvts.com/api/maintenance" \
-H "Content-Type: application/json" \
-H "Cookie: JSESSIONID=your_session_cookie"
200 OK - Response Body
[
  {
    "id": 0,
    "name": "string",
    "type": "string",
    "start": 0,
    "period": 0,
    "attributes": {}
  }
]

Create Schedule

🛠 Endpoint:

POST /maintenance

Authorization:

Supports both:

  • Basic Authentication (basicAuth)
  • Cookie Authentication (session cookie)

cURL Examples:

Basic Authentication:

curl -u username:password -X POST "https://itsochvts.com/api/maintenance" \
-H "Content-Type: application/json" \
-d '{"name": "string", "type": "string", "start": 0, "period": 0, "attributes": {}}'

Cookie Authentication:

curl -X POST "https://itsochvts.com/api/maintenance" \
-H "Content-Type: application/json" \
-H "Cookie: JSESSIONID=your_session_cookie" \
-d '{"name": "string", "type": "string", "start": 0, "period": 0, "attributes": {}}'

Request Body:

{
  "id": 0,
  "name": "string",
  "type": "string",
  "start": 0,
  "period": 0,
  "attributes": {}
}
200 OK - Response Body
{
  "id": 0,
  "name": "string",
  "type": "string",
  "start": 0,
  "period": 0,
  "attributes": {}
}

Update Schedule

🛠 Endpoint:

PUT /maintenance/{id}

Authorization:

Supports both:

  • Basic Authentication (basicAuth)
  • Cookie Authentication (session cookie)

Path Parameters:

Parameter Type Description
id integer ID of maintenance record to update

cURL Examples:

Basic Authentication:

curl -u username:password -X PUT "https://itsochvts.com/api/maintenance/1" \
-H "Content-Type: application/json" \
-d '{"name": "string", "type": "string", "start": 0, "period": 0, "attributes": {}}'

Cookie Authentication:

curl -X PUT "https://itsochvts.com/api/maintenance/1" \
-H "Content-Type: application/json" \
-H "Cookie: JSESSIONID=your_session_cookie" \
-d '{"name": "string", "type": "string", "start": 0, "period": 0, "attributes": {}}'

Request Body:

{
  "id": 0,
  "name": "string",
  "type": "string",
  "start": 0,
  "period": 0,
  "attributes": {}
}
200 OK - Response Body
{
  "id": 0,
  "name": "string",
  "type": "string",
  "start": 0,
  "period": 0,
  "attributes": {}
}

Delete Schedule

🛠 Endpoint:

DELETE /maintenance/{id}

Authorization:

Supports both:

  • Basic Authentication (basicAuth)
  • Cookie Authentication (session cookie)

Path Parameters:

Parameter Type Description
id integer ID of maintenance record to delete

cURL Examples:

Basic Authentication:

curl -u username:password -X DELETE "https://itsochvts.com/api/maintenance/1" \
-H "Content-Type: application/json"

Cookie Authentication:

curl -X DELETE "https://itsochvts.com/api/maintenance/1" \
-H "Content-Type: application/json" \
-H "Cookie: JSESSIONID=your_session_cookie"
204 No Content