Skip to content

Commit 8001f0f

Browse files
committed
[APT-1257] documentation for hourly absence creation new endpoint
1 parent a75515a commit 8001f0f

File tree

1 file changed

+229
-6
lines changed

1 file changed

+229
-6
lines changed

personio-personnel-data-api-oa3.yaml

Lines changed: 229 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ paths:
17401740
application/x-www-form-urlencoded:
17411741
schema:
17421742
$ref: "#/components/schemas/CreateTimeOffPeriodRequest"
1743-
description: Absense data
1743+
description: Absence data
17441744
required: true
17451745
x-readme:
17461746
code-samples:
@@ -1749,7 +1749,7 @@ paths:
17491749
- language: "php"
17501750
code: "Auto-generated code snippets for this language may not be supported"
17511751
responses:
1752-
"201":
1752+
"200":
17531753
description: The absence period is successfully created
17541754
content:
17551755
application/json:
@@ -1831,7 +1831,7 @@ paths:
18311831
success: false
18321832
error:
18331833
code: 0
1834-
message: 'Something went wrong'
1834+
message: 'Time-off type not found.'
18351835

18361836
"422":
18371837
description: Validation error
@@ -2107,6 +2107,7 @@ paths:
21072107
type: AbsenceType
21082108
attributes:
21092109
id: "9bba303f-0fbc-4514-9958-0befa21923fb"
2110+
name: "Absence Type Name"
21102111
certificate:
21112112
status: not-required
21122113
start: "2022-05-31T22:00:00.0Z"
@@ -2139,6 +2140,146 @@ paths:
21392140
problem+json:
21402141
schema:
21412142
$ref: "#/components/schemas/ErrorResponse"
2143+
post:
2144+
security:
2145+
- BearerAuth: [ ]
2146+
tags:
2147+
- Absences
2148+
description: Adds absence data for absence types **tracked in hours**.
2149+
requestBody:
2150+
content:
2151+
application/x-www-form-urlencoded:
2152+
schema:
2153+
$ref: "#/components/schemas/CreateAbsencePeriodRequest"
2154+
description: Absence data
2155+
required: true
2156+
x-readme:
2157+
code-samples:
2158+
- language: "powershell"
2159+
code: "Auto-generated code snippets for this language may not be supported"
2160+
- language: "php"
2161+
code: "Auto-generated code snippets for this language may not be supported"
2162+
responses:
2163+
"201":
2164+
description: The absence period is successfully created
2165+
content:
2166+
application/json:
2167+
schema:
2168+
type: object
2169+
properties:
2170+
data:
2171+
$ref: "#/components/schemas/HourlyAbsencePeriodResponse"
2172+
examples:
2173+
response:
2174+
value:
2175+
success: true
2176+
data:
2177+
- type: AbsencePeriod
2178+
attributes:
2179+
id: 9bba303f-0fbc-4514-9958-0befa21923fb
2180+
measurement_unit: "hour"
2181+
effective_duration: 960
2182+
employee:
2183+
type: Employee
2184+
attributes:
2185+
id:
2186+
label: id
2187+
value: 2367
2188+
type: integer
2189+
universal_id: id
2190+
first_name:
2191+
label: First name
2192+
value: Michael
2193+
type: standard
2194+
universal_id: first_name
2195+
last_name:
2196+
label: Last name
2197+
value: Miller
2198+
type: standard
2199+
universal_id: last_name
2200+
email:
2201+
label: Email
2202+
2203+
type: standard
2204+
universal_id: email
2205+
absence_type:
2206+
type: AbsenceType
2207+
attributes:
2208+
id: "9bba303f-0fbc-4514-9958-0befa21923fb"
2209+
name: "Absence Type Name"
2210+
certificate:
2211+
status: not-required
2212+
start: "2022-05-31T22:00:00.0Z"
2213+
end: "2022-06-02T22:00:00.0Z"
2214+
half_day_start: true
2215+
half_day_end: false
2216+
comment: "this is a comment"
2217+
origin: "web"
2218+
status: "approved"
2219+
created_by: 1
2220+
created_at: "2022-06-20T14:29:56.510Z"
2221+
updated_at: "2022-06-20T14:29:56.510Z"
2222+
approved_at: "2022-06-20T14:29:56.510Z"
2223+
breakdowns:
2224+
- date: "2022-06-01"
2225+
effective_duration: 480
2226+
- date: "2022-06-02"
2227+
effective_duration: 480
2228+
"400":
2229+
description: Invalid request
2230+
content:
2231+
application/json:
2232+
schema:
2233+
$ref: "#/components/schemas/ErrorInsertingAbsenceResponse"
2234+
examples:
2235+
response:
2236+
value:
2237+
success: false
2238+
error:
2239+
code: 400
2240+
message: 'Error when trying to insert absence period'
2241+
2242+
"404":
2243+
description: Employee or Absence type not found
2244+
content:
2245+
application/json:
2246+
schema:
2247+
$ref: "#/components/schemas/ErrorResponse"
2248+
examples:
2249+
response:
2250+
value:
2251+
success: false
2252+
error:
2253+
code: 0
2254+
message: 'Absence type not found.'
2255+
2256+
"422":
2257+
description: Validation error
2258+
content:
2259+
application/json:
2260+
schema:
2261+
$ref: "#/components/schemas/ErrorCreateAbsenceResponse"
2262+
examples:
2263+
response:
2264+
value:
2265+
success: false
2266+
error:
2267+
code: 0
2268+
message: 'The given data failed to pass validation.'
2269+
error_data: '{...}'
2270+
"500":
2271+
description: Internal server error
2272+
content:
2273+
application/json:
2274+
schema:
2275+
$ref: "#/components/schemas/ErrorResponse"
2276+
examples:
2277+
response:
2278+
value:
2279+
success: false
2280+
error:
2281+
code: 0
2282+
message: 'Something went wrong'
21422283

21432284
"/company/document-categories":
21442285
parameters:
@@ -2721,7 +2862,7 @@ components:
27212862
example: The absence period was not found.
27222863

27232864
ErrorInsertingAbsenceResponse:
2724-
title: 400 absense error
2865+
title: 400 absence error
27252866
type: object
27262867
properties:
27272868
success:
@@ -3808,11 +3949,11 @@ components:
38083949
half_day_start:
38093950
type: boolean
38103951
example: false
3811-
description: Weather the start date is a half-day off.
3952+
description: Whether the start date is a half-day off.
38123953
half_day_end:
38133954
type: boolean
38143955
example: false
3815-
description: Weather the end date is a half-day off.
3956+
description: Whether the end date is a half-day off.
38163957
comment:
38173958
type: string
38183959
example: Some Comment
@@ -3828,6 +3969,67 @@ components:
38283969
- end_date
38293970
- half_day_start
38303971
- half_day_end
3972+
CreateAbsencePeriodRequest:
3973+
title: Create Absence periods **tracked in hours**
3974+
type: object
3975+
properties:
3976+
employee_id:
3977+
type: integer
3978+
description: Employee identifier
3979+
absence_type_id:
3980+
type: string
3981+
format: uuid
3982+
description: Absence type identifier
3983+
start_date:
3984+
type: string
3985+
format: date
3986+
description: "Absence start date. Format: yyyy-mm-dd"
3987+
example: '2020-01-31'
3988+
end_date:
3989+
type: string
3990+
format: date
3991+
description: "Absence end date. Format: yyyy-mm-dd"
3992+
example: '2020-01-31'
3993+
full_day:
3994+
type: boolean
3995+
example: false
3996+
description: Whether it's a full day absence or not, only required if the start_date and end_date are the same (one day absence at most)
3997+
start_time:
3998+
type: string
3999+
format: date
4000+
description: "Absence start time. Format: HH:ii and only required if the start_date and end_date are the same, and full_day is false (partial-day absence)"
4001+
example: '03:00'
4002+
end_time:
4003+
type: string
4004+
format: date
4005+
description: "Absence end time. Format: HH:ii and only required if the start_date and end_date are the same, and full_day is false (partial-day absence)"
4006+
example: '15:00'
4007+
half_day_start:
4008+
type: boolean
4009+
example: false
4010+
description: Whether the start date is a half-day off, only required if the start_date and end_date are not the same (more than one day absence)
4011+
half_day_end:
4012+
type: boolean
4013+
example: false
4014+
description: Whether the end date is a half-day off, only required if the start_date and end_date are not the same (more than one day absence)
4015+
comment:
4016+
type: string
4017+
example: Some Comment
4018+
description: Optional comment
4019+
skip_approval:
4020+
type: boolean
4021+
example: false
4022+
description: Optional, default value is true. If set to false, the approval status of the absence request will be "pending" if an approval rule is set for the absence type in Personio. The respective approval flow will be triggered.
4023+
required:
4024+
- employee_id
4025+
- absence_type_id
4026+
- start_date
4027+
- end_date
4028+
- full_day
4029+
- start_time
4030+
- end_time
4031+
- half_day_start
4032+
- half_day_end
38314033
AbsencePeriodsResponse:
38324034
title: List All Absence Periods response
38334035
type: object
@@ -4004,6 +4206,24 @@ components:
40044206
attributes:
40054207
$ref: "#/components/schemas/Absence"
40064208

4209+
HourlyAbsencePeriodResponse:
4210+
title: Absence Periods response
4211+
type: object
4212+
allOf:
4213+
- $ref: "#/components/schemas/Response"
4214+
- type: object
4215+
properties:
4216+
data:
4217+
type: object
4218+
required:
4219+
- type
4220+
- attributes
4221+
properties:
4222+
type:
4223+
example: AbsencePeriod
4224+
attributes:
4225+
$ref: "#/components/schemas/HourlyAbsence"
4226+
40074227
Absence:
40084228
type: object
40094229
properties:
@@ -4127,6 +4347,9 @@ components:
41274347
type: string
41284348
format: uuid
41294349
example: 61fe126b-a7b3-449a-b5ee-3865a6fcc546
4350+
name:
4351+
type: string
4352+
example: Absence Type Name
41304353
AbsencePeriodBreakdown:
41314354
type: object
41324355
required:

0 commit comments

Comments
 (0)