Group Time Schedules¶
Retrieve the group’s time schedules list¶
-
GET
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
¶ Retrieve the group’s time schedules list.
Restricted authorization rights: minimum Group Admin for these parameters:
allLevels
Example request:
GET /api/v1/tenants/foo/groups/foogroup/time_schedules/ HTTP/1.1 Host: example.com Content-Type: "application/json"
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "schedules": [ { "name": "APIO Test Time Schedule" } ] }
- Response JSON Object:
schedules (array) – A list of objects as defined in Schedule entry attributes.
Example request:
GET /api/v1/tenants/foo/groups/foogroup/time_schedules/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "allLevels": True }
- Request JSON Object:
allLevels (boolean) – (Optional) If true, the parent level schedules will be included within the response (only in case the Tenant is an Enterprise).
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "schedules": [ { "name": "APIO Test Time Schedule", "level": "Group" } ] }
- Response JSON Object:
schedules (array) – A list of objects as defined in Schedule entry attributes.
- Status Codes:
200 OK – no error
Create a new group’s time schedule instance¶
-
POST
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
¶ Create a new group’s time schedule instance without any periods.
Example request:
POST /api/v1/tenants/foo/groups/foogroup/time_schedules/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "name": "APIO Test Time Schedule" }
- Request JSON Object:
name (string) – see name from Schedule entry attributes.
periods (string) – see periods from Schedule entry attributes.
Example response:
- Response:
Similar to GET instance method response.
- Status Codes:
201 Created – created
400 Bad Request – failed to create
Create a new group’s calendar schedule instance with some periods.
Example request:
POST /api/v1/tenants/foo/groups/foogroup/time_schedules/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "name": "APIO Test Time Schedule", "periods": [ { "name": "APIO Test Group Period 1", "type": "Day of the week", "dayOfWeek": "Friday", "startTime": "10:30", "stopTime": "12:30" }, { "name": "APIO Test Group Period 2", "type": "Day of the month", "dayOfMonth": 10, "startTime": "9:45", "stopTime": "13:15", "active": false } ] }
- Request JSON Object:
name (string) – see name from Schedule entry attributes.
periods (string) – see periods from Schedule entry attributes.
Example response:
- Response:
Similar to GET instance method response.
- Status Codes:
201 Created – created
400 Bad Request – failed to create
Retrieve a group’s time schedule instance¶
-
GET
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
(string: instance_name)/
¶ Retrieve a group’s time schedule instance.
Example request:
GET /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule/ HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "name": "APIO Test Time Schedule", "periods" [ {"name": "APIO Test Group Period 1"}, {"name": "APIO Test Group Period 2"} ] }
- Response JSON Object:
name (string) – see name from Schedule entry attributes.
periods (array) – see periods from Schedule entry attributes.
- Status Codes:
200 OK – no error
400 Bad Request – failed
404 Not Found – not found
Retrieve a group’s time schedule instance with full period detail list.
Example request:
GET /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule/ HTTP/1.1 Host: example.com { "full_list": true }
- Request JSON Object:
full_list (boolean) – Optional. Default false. To request the full period detail list.
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "name": "APIO Test Time Schedule", "periods": [ { "name": "APIO Test Group Period 1", "type": "Day of the week", "dayOfWeek": "Friday", "startTime": "10:30", "stopTime": "12:30" }, { "name": "APIO Test Group Period 2", "type": "Day of the month", "dayOfMonth": 10, "startTime": "9:45", "stopTime": "13:15", "active": false } ] }
- Response JSON Object:
name (string) – see name from Schedule entry attributes.
periods (array) – see periods from Schedule entry attributes.
- Status Codes:
200 OK – no error
404 Not Found – not found
the request can not be executed, with possible sub-error codes:
62: SCHEDULE_NOT_COMPATIBLE_SIMPLE_MODE, “Schedule period not compatible with simplified mode”, it means that the schedule was created with the Adnaced Schedule APis using recurrences not compatible with this simplified version
Update a group’s time schedule instance¶
-
PUT
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
(string: instance_name)/
¶ Update a group’s time schedule instance.
Example request:
PUT /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule/ HTTP/1.1 Host: example.com { "name": "APIO Test Time Schedule New" }
- Request JSON Object:
name (string) – see name from Schedule entry attributes.
periods (array) – see periods from Schedule entry attributes.
Example response:
- Response:
Similar to GET instance method response.
- Status Codes:
200 OK – no error
400 Bad Request – failed
Update a group’s time schedule instance with period list (1. update an existing one, 2. delete an existing one, 3. create a new one).
Example request:
PUT /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule/ HTTP/1.1 Host: example.com { "name": "APIO Test Time Schedule New", "periods": [ { "name": "APIO Test Group Period 1", "newName": "APIO Test Group Updated Period 1", "startTime": "11:30", "stopTime": "15:30" }, { "name": "APIO Test Group Period 2", "delete": true }, { "name": "APIO Test Group Period 3", "type": "Day of the month", "dayOfMonth": 20, "startTime": "9:15", "stopTime": "14:45", "active": true } ] }
- Request JSON Object:
name (string) – see name from Schedule entry attributes.
periods (array) – see periods from Schedule entry attributes.
Example response:
- Response:
Similar to GET instance method response.
- Status Codes:
200 OK – no error
400 Bad Request – failed
Delete group’s time schedules list¶
-
DELETE
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
¶ Delete a group’s time schedules list.
Example request:
DELETE /api/v1/tenants/foo/groups/foogroup/time_schedules/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "schedules: [ "APIO Test Time Schedule New" ] }
- Request JSON Object:
schedules (array) – A list of objects as defined in Schedule entry attributes.
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" {}
- Status Codes:
200 OK – no error
Delete a group’s time schedule instance¶
-
DELETE
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
(string: instance_name)/
¶ Delete a group’s time schedule instance.
Example request:
DELETE /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule%20New/ HTTP/1.1 Host: example.com Content-Type: "application/json"
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" {}
- Status Codes:
200 OK – no error
Time Schedule Periods¶
Create a new group’s time schedule period instance¶
-
POST
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
(string: instance_name)/
¶ Create a new group’s time schedule period instance.
Example request:
POST /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "name": "APIO Test Group Period 1", "type": "Day of the week", "dayOfWeek": "Friday", "startTime": "10:30", "stopTime": "12:30", "active": true }
- Request JSON Object:
name (string) – see name from Time Schedule Period entry attributes.
startTime (string) – see startTime from Time Schedule Period entry attributes.
stopTime (string) – see stopTime from Time Schedule Period entry attributes.
type (string) – see type from Time Schedule Period entry attributes.
dayOfWeek (string) – see dayOfWeek from Time Schedule Period entry attributes.
dayOfMonth (string) – see dayOfMonth from Time Schedule Period entry attributes.
- Response JSON Object:
active (boolean) – see active from Time Schedule Period entry attributes.
Example response:
- Response:
Similar to GET instance method response.
- Status Codes:
201 Created – created
400 Bad Request – failed to create
Retrieve a group’s time schedule period instance¶
-
GET
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
(string: instance_name)/
(string: sub_instance_name)/
¶ Retrieve a group’s time schedule period instance.
Example request:
GET /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule/ HTTP/1.1 Host: example.com
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" { "name": "APIO Test Group Period 1", "type": "Day of the week", "dayOfWeek": "Friday", "startTime": "10:30", "stopTime": "12:30", "active": true }
- Response JSON Object:
name (string) – see name from Time Schedule Period entry attributes.
startTime (string) – see startTime from Time Schedule Period entry attributes.
stopTime (string) – see stopTime from Time Schedule Period entry attributes.
type (string) – see type from Time Schedule Period entry attributes.
dayOfWeek (string) – see dayOfWeek from Time Schedule Period entry attributes.
dayOfMonth (string) – see dayOfMonth from Time Schedule Period entry attributes.
active (boolean) – see active from Time Schedule Period entry attributes.
- Status Codes:
200 OK – no error
404 Not Found – not found
the request can not be executed, with possible sub-error codes:
62: SCHEDULE_NOT_COMPATIBLE_SIMPLE_MODE, “Schedule period not compatible with simplified mode”, it means that the schedule was created with the Adnaced Schedule APis using recurrences not compatible with this simplified version
Update a group’s time schedule period instance¶
-
PUT
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
(string: instance_name)/
(string: sub_instance_name)/
¶ Update a group’s time schedule period instance.
Example request:
POST /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule/APIO%20Test%20Group%20Period%201/ HTTP/1.1 Host: example.com Content-Type: "application/json" { "name": "APIO Test Group Updated Period 1", "type": "Day of the week", "dayOfWeek": "Monday", "startTime": "11:30", "stopTime": "15:30" }
- Request JSON Object:
name (string) – see name from Time Schedule Period entry attributes.
startTime (string) – see startTime from Time Schedule Period entry attributes.
stopTime (string) – see stopTime from Time Schedule Period entry attributes.
type (string) – see type from Time Schedule Period entry attributes.
dayOfWeek (string) – see dayOfWeek from Time Schedule Period entry attributes.
dayOfMonth (string) – see dayOfMonth from Time Schedule Period entry attributes.
- Response JSON Object:
active (boolean) – see active from Time Schedule Period entry attributes.
Example response:
- Response:
Similar to GET instance method response.
- Status Codes:
200 OK – no error
400 Bad Request – failed to
Delete a group’s time schedule period instance¶
-
DELETE
/api/v1/tenants/
(string: tenant_id)/groups/
(string: group_id)/time_schedules/
(string: instance_name)/
(string: sub_instance_name)/
¶ Delete a group’s time schedule period instance.
Example request:
DELETE /api/v1/tenants/foo/groups/foogroup/time_schedules/APIO%20Test%20Time%20Schedule/APIO%20Test%20Group%20Period%201/ HTTP/1.1 Host: example.com Content-Type: "application/json"
Example response:
HTTP/1.1 200 OK Content-Type: "application/json" {}
- Status Codes:
200 OK – no error