Time Schedules

Retrieve the tenant’s time schedules list

GET /api/v1/tenants/(string: tenant_id)/time_schedules/

Retrieve the tenant’s time schedules list.

Authorization Right:minimum Group Admin.

Example request:

GET /api/v1/tenants/foo/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:
Status Codes:

Create a new tenant’s time schedule instance

POST /api/v1/tenants/(string: tenant_id)/time_schedules/

Create a new tenant’s time schedule instance without any periods.

Authorization Right:minimum Group Admin.

Example request:

POST /api/v1/tenants/foo/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 tenant’s calendar schedule instance with some periods.

Example request:

POST /api/v1/tenants/foo/time_schedules/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "name": "APIO Test Time Schedule",
   "periods": [
      {
         "name": "APIO Test Tenant Period 1",
         "type": "Day of the week",
         "dayOfWeek": "Friday",
         "startTime": "10:30",
         "stopTime": "12:30"
      },
      {
         "name": "APIO Test Tenant 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 tenant’s time schedule instance

GET /api/v1/tenants/(string: tenant_id)/time_schedules/(string: instance_name)/

Retrieve a tenant’s time schedule instance.

Authorization Right:minimum End User.

Example request:

GET /api/v1/tenants/foo/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 Tenant Period 1"},
      {"name": "APIO Test Tenant Period 2"}
   ]
}
Response JSON Object:
Status Codes:

Retrieve a tenant’s time schedule instance with full period detail list.

Example request:

GET /api/v1/tenants/foo/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 Tenant Period 1",
         "type": "Day of the week",
         "dayOfWeek": "Friday",
         "startTime": "10:30",
         "stopTime": "12:30"
      },
      {
         "name": "APIO Test Tenant 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 tenant’s time schedule instance

PUT /api/v1/tenants/(string: tenant_id)/time_schedules/(string: instance_name)/

Update a tenant’s time schedule instance.

Authorization Right:minimum Tenant Admin.

Example request:

PUT /api/v1/tenants/foo/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 tenant’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/time_schedules/APIO%20Test%20Time%20Schedule/ HTTP/1.1
Host: example.com

{
   "name": "APIO Test Time Schedule New",
   "periods": [
      {
         "name": "APIO Test Tenant Period 1",
         "newName": "APIO Test Tenant Updated Period 1",
         "type": "Day of the month",
         "dayOfMonth": 20,
         "startTime": "11:30",
         "stopTime": "15:30"
      },
      {
         "name": "APIO Test Tenant Period 2",
         "delete": true,
         "type": "Day of the month",
         "dayOfMonth": 20
      },
      {
         "name": "APIO Test Tenant 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 tenant’s time schedules list

DELETE /api/v1/tenants/(string: tenant_id)/time_schedules/

Delete a tenant’s time schedules list.

Authorization Right:minimum Tenant Admin.

Example request:

DELETE /api/v1/tenants/foo/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 tenant’s time schedule instance

DELETE /api/v1/tenants/(string: tenant_id)/time_schedules/(string: instance_name)/

Delete a tenant’s time schedule instance.

Authorization Right:minimum Tenant Admin.

Example request:

DELETE /api/v1/tenants/foo/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 tenant’s time schedule period instance

POST /api/v1/tenants/(string: tenant_id)/time_schedules/(string: instance_name)/

Create a new tenant’s time schedule period instance.

Authorization Right:minimum Tenant Admin.

Example request:

POST /api/v1/tenants/foo/time_schedules/APIO%20Test%20Time%20Schedule/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "name": "APIO Test Tenant 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 tenant’s time schedule period instance

GET /api/v1/tenants/(string: tenant_id)/time_schedules/(string: instance_name)/(string: sub_instance_name)/

Retrieve a tenant’s time schedule period instance.

Authorization Right:minimum End User.

Example request:

GET /api/v1/tenants/foo/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 Tenant 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 tenant’s time schedule period instance

PUT /api/v1/tenants/(string: tenant_id)/time_schedules/(string: instance_name)/(string: sub_instance_name)/

Update a tenant’s time schedule period instance.

Authorization Right:minimum Tenant Admin.

Example request:

PUT /api/v1/tenants/foo/time_schedules/APIO%20Test%20Time%20Schedule/APIO%20Test%20Group%20Period%201/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "name": "APIO Test Tenant 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 tenant’s time schedule period instance

DELETE /api/v1/tenants/(string: tenant_id)/time_schedules/(string: instance_name)/(string: sub_instance_name)/

Delete a tenant’s time schedule period instance.

Authorization Right:minimum Tenant Admin.

Example request:

DELETE /api/v1/tenants/foo/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: