Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section

API documentation

General

Health check

Get Unimus health status.

Method: GET

Panel
borderColorgrey
borderStylesolid

http://example.unimus/api/v1/heatlh

CURL

Panel
borderColorgrey
borderStylesolid

curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/health"

Success 200

FieldTypeDescription
statusString

OK - Unimus is ready to handle all requests.

LICENSING_UNREACHABLE - License server is unreachable. All request will proceed except add, remove and update device.

ERROR - Unimus require user interaction to solve the problem. All requests will be refused.

 

 

 

 

Panel
borderColorgrey
borderStylesolid
titleSuccess response

 HTTP/1.1 200 OK

{

"data": {
"status": "OK"
}

}


 


 

Schedules

Schedules - get schedule

Get an individual schedule.

Method: GET

Panel
borderColorgrey
borderStylesolid

http://example.unimus/api/v1/schedules/:scheduleId

CURL

Panel
borderColorgrey
borderStylesolid

curl -H "Accept: application/json" -H "Authorization: Bearer <token>" "http://<example.unimus>/api/v1/schedules/<scheduleId>"

Parameter

FieldTypeDescription
scheduleIdNumberThe ID of the schedule

Success 200

FieldTypeDescription
 idNumber  The ID of the schedule
createTimeNumberSchedule creation time in seconds
periodicityStringSchedule periodicity. Possible values: MONTHLY, WEEKLY, DAILY, HOURLY
domNumberDay of month
dowNumberDay of week
hourNumberHour of day
minNumberMinute of hour
nameStringSchedule pretty name

 

 

Panel
borderColorgrey
borderStylesolid
titleSuccess response

HTTP/1.1 200 OK

{

"data": {
"id": 7,
"createTime": 1511863250,
"periodicity": "MONTHLY",
"dom": 1,
"dow": 1,
"hour": 0,
"min": 6,
"name": "Every month, on day 1, at 00:06."
}

}

Error 4xx

NameTypeDescription
timestamp Number Current timestamp
 code Number404
 error String HTTP code message
 messageString  Error message
Panel
borderColorgrey
borderStylesolid
titleError response

HTTP/1.1 404 NOT FOUND

{

"timestamp": 1511862182524,
"code": 404,
"error": "Not Found",
"message": "Schedule with id 11 not found"

}