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:

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:
Status Codes:

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:

Example response:

Response:

Similar to GET instance method response.

Status Codes:

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:

Example response:

Response:

Similar to GET instance method response.

Status Codes:

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:
Status Codes:

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:
Status Codes:
  • 200 OK – no error

  • 404 Not Found – not found

  • 400 Bad Request

    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:

Example response:

Response:

Similar to GET instance method response.

Status Codes:

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:

Example response:

Response:

Similar to GET instance method response.

Status Codes:

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:

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{}
Status Codes:

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:

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:
Response JSON Object:

Example response:

Response:

Similar to GET instance method response.

Status Codes:

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:
Status Codes:
  • 200 OK – no error

  • 404 Not Found – not found

  • 400 Bad Request

    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:
Response JSON Object:

Example response:

Response:

Similar to GET instance method response.

Status Codes:

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: