Work schedule days (workdays)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new schedule day
Request
Field Description: workday entity
POST /rest/v1/domain/workdays HTTP/1.1
Content-Type: application/json; charset=utf-8
workday entity
Response
Field Description: workday entity
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
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, date, isannual, isworkday, asdow, opts.title, ext.lwt, ext.ct. |
|
|
Offset in the list of resources to be issued. |
|
|
The maximum number of resources in the list. |
|
|
The sort order of the resources in the list. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/domain/workdays?filter={"isannual":"true"}&offset=0&limit=3 HTTP/1.1
Response
Field Description: workday entity
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
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/domain/workdays/23f7d261-016c-bd79-505d-50e54938780c HTTP/1.1
Response
Field Description: workday entity
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
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
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
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
LOOKUP /rest/v1/domain/workdays HTTP/1.1
Content-Type: application/json; charset=utf-8
"2017-05-01"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"23f7d261-016c-bd79-505d-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}