Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit c5c9e65

Browse files
Merge pull request #815 from teamleadercrm/feature/CON-3/days-off
[CON-3] Introduce /daysOff - /daysOffTypes - /closingDays endpoints
2 parents ebe3339 + c2fd6b8 commit c5c9e65

File tree

6 files changed

+167
-2
lines changed

6 files changed

+167
-2
lines changed

apiary.apib

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ We list all backwards-compatible additions here. These are currently available i
428428

429429
#### June 2024
430430
- We added `tax` to the `products.info` endpoint.
431+
- We added the `daysOff.import` and `daysOff.bulkDelete` endpoints.
432+
- We added the `dayOffTypes.create` and `dayOffTypes.delete` endpoints.
433+
- We added the `closingDays.add` and `closingDays.delete` endpoints.
431434

432435
#### May 2024
433436
- We added `purchase_order_number` to `projects-v2/projects.info`, `projects-v2/projects.create` and `projects-v2/projects.update`.
@@ -1786,7 +1789,7 @@ Create a new email tracking.
17861789

17871790
### closingDays.list [POST /closingDays.list]
17881791

1789-
Returns information about closing days the account
1792+
Returns information about closing days of the account
17901793

17911794
+ Request (application/json)
17921795
+ Attributes (object)
@@ -1805,6 +1808,29 @@ Returns information about closing days the account
18051808
+ page (Pagination)
18061809
+ matches: `12` (number)
18071810

1811+
### closingDays.add [POST /closingDays.add]
1812+
1813+
Adds a closing day for the account.
1814+
1815+
+ Request (application/json)
1816+
+ Attributes (object)
1817+
+ `day`: `2024-02-01` (string, required)
1818+
1819+
+ Response 201 (application/json)
1820+
+ Attributes (object)
1821+
+ data (object)
1822+
+ type: `closingDay` (string)
1823+
+ id: `eb264fd0-0e5c-0dbf-ae1e-49e7d6a8e6b8` (string, required)
1824+
1825+
### closingDays.delete [POST /closingDays.delete]
1826+
1827+
Removes a closing day for the account.
1828+
1829+
+ Request (application/json)
1830+
+ Attributes (object)
1831+
+ id: `eb264fd0-0e5c-0dbf-ae1e-49e7d6a8e6b8` (string, required)
1832+
1833+
+ Response 204
18081834

18091835
## Day Off Types [/dayOffTypes]
18101836

@@ -1821,6 +1847,62 @@ Returns a list of day off types for the account
18211847
+ `id`: `39263c14-9c16-022d-8513-60cf722ab088` (string)
18221848
+ `name`: `Sick leave` (string)
18231849

1850+
### dayOffTypes.create [POST /dayOffTypes.create]
1851+
1852+
Create a new day off type.
1853+
1854+
+ Request (application/json)
1855+
+ Attributes (object)
1856+
+ name: `day off type` (string, required)
1857+
+ color: `#00B2B2` (string, nullable, optional)
1858+
+ date_validity (object, nullable, optional)
1859+
+ from: `2024-04-04` (string, required)
1860+
+ unit: `2025-05-05` (string, required)
1861+
1862+
1863+
+ Response 201 (application/json)
1864+
+ Attributes (object)
1865+
+ data (object)
1866+
+ type: `dayOffType` (string)
1867+
+ id: `cf307a90-d778-003c-b820-ab8415d1a524` (string)
1868+
1869+
### dayOffTypes.delete [POST /dayOffTypes.delete]
1870+
1871+
Delete a day off type.
1872+
1873+
+ Request (application/json)
1874+
+ Attributes (object)
1875+
+ `id`: `1b7cece0-288c-0bbe-b916-5a315fbe9fe2` (string, required)
1876+
1877+
+ Response 204
1878+
1879+
## Days Off [/daysOff]
1880+
1881+
### daysOff.import [POST /daysOff.import]
1882+
1883+
Imports a list of days off for the given user.
1884+
1885+
+ Request (application/json)
1886+
+ Attributes (object)
1887+
+ `user_id`: `f29abf48-337d-44b4-aad4-585f5277a456` (string, required) - The id of the user that the days off belong to.
1888+
+ `leave_type_id`: `0f517e20-2e76-4684-8d6c-3334f6d7148c` (string, required) - The id of the leave type that is associated with the given days off.
1889+
+ `days` (array, required) - At least one day must be present
1890+
+ (object)
1891+
+ `starts_at`: `2024-02-01T08:00:00+00:00` (string, required)
1892+
+ `ends_at`: `2024-02-01T18:00:00+00:00` (string, required)
1893+
1894+
+ Response 201 (application/json)
1895+
1896+
### daysOff.bulkDelete [POST /daysOff.bulkDelete]
1897+
1898+
Deletes a list of days off for the given user.
1899+
1900+
+ Request (application/json)
1901+
+ Attributes (object)
1902+
+ `user_id`: `f29abf48-337d-44b4-aad4-585f5277a456` (string, required) - The id of the user that the days off belong to.
1903+
+ `ids`: `0a481ce9-0d2a-0913-9439-0fd8b469b566`, `5050789e-4385-02f6-bd3c-d051cc12f5cf` (array[string]) - At least one day off id must be present.
1904+
1905+
+ Response 204 (application/json)
18241906

18251907
# Group CRM
18261908

src/01-general/closing-days.apib

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### closingDays.list [POST /closingDays.list]
44

5-
Returns information about closing days the account
5+
Returns information about closing days of the account
66

77
+ Request (application/json)
88
+ Attributes (object)
@@ -21,3 +21,26 @@ Returns information about closing days the account
2121
+ page (Pagination)
2222
+ matches: `12` (number)
2323

24+
### closingDays.add [POST /closingDays.add]
25+
26+
Adds a closing day for the account.
27+
28+
+ Request (application/json)
29+
+ Attributes (object)
30+
+ `day`: `2024-02-01` (string, required)
31+
32+
+ Response 201 (application/json)
33+
+ Attributes (object)
34+
+ data (object)
35+
+ type: `closingDay` (string)
36+
+ id: `eb264fd0-0e5c-0dbf-ae1e-49e7d6a8e6b8` (string, required)
37+
38+
### closingDays.delete [POST /closingDays.delete]
39+
40+
Removes a closing day for the account.
41+
42+
+ Request (application/json)
43+
+ Attributes (object)
44+
+ id: `eb264fd0-0e5c-0dbf-ae1e-49e7d6a8e6b8` (string, required)
45+
46+
+ Response 204

src/01-general/day-off-types.apib

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,31 @@ Returns a list of day off types for the account
1313
+ `id`: `39263c14-9c16-022d-8513-60cf722ab088` (string)
1414
+ `name`: `Sick leave` (string)
1515

16+
### dayOffTypes.create [POST /dayOffTypes.create]
17+
18+
Create a new day off type.
19+
20+
+ Request (application/json)
21+
+ Attributes (object)
22+
+ name: `day off type` (string, required)
23+
+ color: `#00B2B2` (string, nullable, optional)
24+
+ date_validity (object, nullable, optional)
25+
+ from: `2024-04-04` (string, required)
26+
+ unit: `2025-05-05` (string, required)
27+
28+
29+
+ Response 201 (application/json)
30+
+ Attributes (object)
31+
+ data (object)
32+
+ type: `dayOffType` (string)
33+
+ id: `cf307a90-d778-003c-b820-ab8415d1a524` (string)
34+
35+
### dayOffTypes.delete [POST /dayOffTypes.delete]
36+
37+
Delete a day off type.
38+
39+
+ Request (application/json)
40+
+ Attributes (object)
41+
+ `id`: `1b7cece0-288c-0bbe-b916-5a315fbe9fe2` (string, required)
42+
43+
+ Response 204

src/01-general/days-off.apib

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Days Off [/daysOff]
2+
3+
### daysOff.import [POST /daysOff.import]
4+
5+
Imports a list of days off for the given user.
6+
7+
+ Request (application/json)
8+
+ Attributes (object)
9+
+ `user_id`: `f29abf48-337d-44b4-aad4-585f5277a456` (string, required) - The id of the user that the days off belong to.
10+
+ `leave_type_id`: `0f517e20-2e76-4684-8d6c-3334f6d7148c` (string, required) - The id of the leave type that is associated with the given days off.
11+
+ `days` (array, required) - At least one day must be present
12+
+ (object)
13+
+ `starts_at`: `2024-02-01T08:00:00+00:00` (string, required)
14+
+ `ends_at`: `2024-02-01T18:00:00+00:00` (string, required)
15+
16+
+ Response 201 (application/json)
17+
18+
### daysOff.bulkDelete [POST /daysOff.bulkDelete]
19+
20+
Deletes a list of days off for the given user.
21+
22+
+ Request (application/json)
23+
+ Attributes (object)
24+
+ `user_id`: `f29abf48-337d-44b4-aad4-585f5277a456` (string, required) - The id of the user that the days off belong to.
25+
+ `ids`: `0a481ce9-0d2a-0913-9439-0fd8b469b566`, `5050789e-4385-02f6-bd3c-d051cc12f5cf` (array[string]) - At least one day off id must be present.
26+
27+
+ Response 204 (application/json)

src/apiary.apib

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ HOST: https://api.focus.teamleader.eu
3737

3838
:[Day Off Types](./01-general/day-off-types.apib)
3939

40+
:[Days Off](./01-general/days-off.apib)
41+
4042
# Group CRM
4143

4244
:[Contacts](./02-crm/contacts.apib)

src/changes-backwards-compatible.apib

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ We list all backwards-compatible additions here. These are currently available i
66

77
#### June 2024
88
- We added `tax` to the `products.info` endpoint.
9+
- We added the `daysOff.import` and `daysOff.bulkDelete` endpoints.
10+
- We added the `dayOffTypes.create` and `dayOffTypes.delete` endpoints.
11+
- We added the `closingDays.add` and `closingDays.delete` endpoints.
912

1013
#### May 2024
1114
- We added `purchase_order_number` to `projects-v2/projects.info`, `projects-v2/projects.create` and `projects-v2/projects.update`.

0 commit comments

Comments
 (0)