Work schedule days (workdays)

Overview

Available in the work-domain only.

Requests

HTTP verb Endpoint Description

POST

/rest/v1/domain/workdays

Creating a new schedule day

GET

/rest/v1/domain/workdays

Getting the list of schedule days

GET

/rest/v1/domain/workdays/<id>

Retrieving schedule day data

PATCH

/rest/v1/domain/workdays/<id>

Changing schedule day data

DELETE

/rest/v1/domain/workdays/<id>

Deleting a schedule day

LOOKUP

/rest/v1/domain/workdays

Search for schedule day identifier


Creating a new schedule day

Request

Field Description: workday entity

Request example
POST /rest/v1/domain/workdays HTTP/1.1
Content-Type: application/json; charset=utf-8

workday entity

Response

Field Description: workday entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "23f7d261-016c-bd79-505d-50e54938780c",
  "date": "2018-10-10",
  "isannual": 0,
  "isworkday": 2,
  "asdow": 0,
  "periods": [
    {
      "timestart": 360,
      "timestop": 900
    }
  ],
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-23T07:55:39.99Z",
    "lwt": "2019-08-23T07:55:39.99Z"
  }
}

Getting the list of schedule days

Request

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, date, isannual, isworkday, asdow, opts.title, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/domain/workdays?filter={"isannual":"true"}&offset=0&limit=3 HTTP/1.1

Response

Field Description: workday entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "f66c2eed-016c-bd78-3bc7-50e54938780c",
    "date": "0000-05-01",
    "isannual": 1,
    "isworkday": 0,
    "asdow": 0,
    "periods": [],
    "opts": {
      "title": "One, two, three"
    },
    "ext": {
      "ct": "2019-08-23T07:54:29.19Z",
      "lwt": "2019-08-23T07:54:29.19Z"
    }
  },
  {
    "id": "d290f0cb-016c-bd77-c82d-50e54938780c",
    "date": "2019-09-01",
    "isannual": 0,
    "isworkday": 1,
    "asdow": 5,
    "periods": [],
    "opts": {
      "title": "Workday for Friday"
    },
    "ext": {
      "ct": "2019-08-23T07:53:59.59Z",
      "lwt": "2019-08-23T07:53:59.59Z"
    }
  },
  {
    "id": "23f7d261-016c-bd79-505d-50e54938780c",
    "date": "2018-10-10",
    "isannual": 1,
    "isworkday": 2,
    "asdow": 0,
    "periods": [
      {
        "timestart": 540,
        "timestop": 1080
      }
    ],
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-23T07:55:39.99Z",
      "lwt": "2019-08-23T07:55:39.99Z"
    }
  }
]

Retrieving schedule day data

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/domain/workdays/23f7d261-016c-bd79-505d-50e54938780c HTTP/1.1

Response

Field Description: workday entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "23f7d261-016c-bd79-505d-50e54938780c",
  "date": "2018-10-10",
  "isannual": 0,
  "isworkday": 2,
  "asdow": 0,
  "periods": [
    {
      "timestart": 360,
      "timestop": 900
    }
  ],
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-23T07:55:39.99Z",
    "lwt": "2019-08-23T07:55:39.99Z"
  }
}

Changing schedule day data

Fields prohibited for modification: id

Request

Field Description: workday entity

Request example
PATCH /rest/v1/domain/workdays/23f7d261-016c-bd79-505d-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

workday entity

Response

Field Description: workday entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "23f7d261-016c-bd79-505d-50e54938780c",
  "date": "2018-10-10",
  "isannual": 1,
  "isworkday": 2,
  "asdow": 0,
  "periods": [
    {
      "timestart": 540,
      "timestop": 1080
    }
  ],
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-23T07:55:39.99Z",
    "lwt": "2019-09-11T10:19:59.02Z"
  }
}

Deleting a schedule day

Request

Request example
DELETE /rest/v1/domain/workdays/23f7d261-016c-bd79-505d-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Search for schedule day identifier

Searches the resource for the specified key, returns the identifier(s) to build the endpoint.

Key fields to search for: id, date

Request

Request example
LOOKUP /rest/v1/domain/workdays HTTP/1.1
Content-Type: application/json; charset=utf-8

"2017-05-01"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "23f7d261-016c-bd79-505d-50e54938780c"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}