Work schedule days (workdays)

Overview

Available only in a working domain.

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>

Getting schedule day data

PATCH

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

Modifying schedule day data

DELETE

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

Deleting a schedule day

LOOKUP

/rest/v1/domain/workdays

Searching for a schedule day identifier


Creating a new schedule day

Request

Field description: workday entity

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

workday entity

Response

Field description: workday entity

Example response
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 output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

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

Response

Field description: workday entity

Example response
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": "Peace, labor, May"

    },
    "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": "Worker 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"
    }
  }
]

Getting schedule day data

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

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

Response

Field description: workday entity

Example response
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"
  }
}

Modifying schedule day data

Fields prohibited for modification: id

Request

Field description: workday entity

Example request
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

Example response
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

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

Response

Example response
HTTP/1.1 204 No Content

Searching for a schedule day identifier

Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.

Key fields for search: id, date

Request

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

"2017-05-01"

Response

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

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

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