Skip to content

Commit 591336c

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

File tree

1 file changed

+234
-6
lines changed

1 file changed

+234
-6
lines changed

personio-personnel-data-api-oa3.yaml

Lines changed: 234 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,147 @@ 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 was 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+
timezone: "Europe/Berlin"
2220+
created_by: 1
2221+
created_at: "2022-06-20T14:29:56.510Z"
2222+
updated_at: "2022-06-20T14:29:56.510Z"
2223+
approved_at: "2022-06-20T14:29:56.510Z"
2224+
breakdowns:
2225+
- date: "2022-06-01"
2226+
effective_duration: 480
2227+
- date: "2022-06-02"
2228+
effective_duration: 480
2229+
"400":
2230+
description: Invalid request
2231+
content:
2232+
application/json:
2233+
schema:
2234+
$ref: "#/components/schemas/ErrorInsertingAbsenceResponse"
2235+
examples:
2236+
response:
2237+
value:
2238+
success: false
2239+
error:
2240+
code: 400
2241+
message: 'Error when trying to insert absence period'
2242+
2243+
"404":
2244+
description: Employee or Absence type not found
2245+
content:
2246+
application/json:
2247+
schema:
2248+
$ref: "#/components/schemas/ErrorResponse"
2249+
examples:
2250+
response:
2251+
value:
2252+
success: false
2253+
error:
2254+
code: 0
2255+
message: 'Absence type not found.'
2256+
2257+
"422":
2258+
description: Validation error
2259+
content:
2260+
application/json:
2261+
schema:
2262+
$ref: "#/components/schemas/ErrorCreateAbsenceResponse"
2263+
examples:
2264+
response:
2265+
value:
2266+
success: false
2267+
error:
2268+
code: 0
2269+
message: 'The given data failed to pass validation.'
2270+
error_data: '{...}'
2271+
"500":
2272+
description: Internal server error
2273+
content:
2274+
application/json:
2275+
schema:
2276+
$ref: "#/components/schemas/ErrorResponse"
2277+
examples:
2278+
response:
2279+
value:
2280+
success: false
2281+
error:
2282+
code: 0
2283+
message: 'Something went wrong'
21422284

21432285
"/company/document-categories":
21442286
parameters:
@@ -2721,7 +2863,7 @@ components:
27212863
example: The absence period was not found.
27222864

27232865
ErrorInsertingAbsenceResponse:
2724-
title: 400 absense error
2866+
title: 400 absence error
27252867
type: object
27262868
properties:
27272869
success:
@@ -3808,11 +3950,11 @@ components:
38083950
half_day_start:
38093951
type: boolean
38103952
example: false
3811-
description: Weather the start date is a half-day off.
3953+
description: Whether the start date is a half-day off.
38123954
half_day_end:
38133955
type: boolean
38143956
example: false
3815-
description: Weather the end date is a half-day off.
3957+
description: Whether the end date is a half-day off.
38163958
comment:
38173959
type: string
38183960
example: Some Comment
@@ -3828,6 +3970,64 @@ components:
38283970
- end_date
38293971
- half_day_start
38303972
- half_day_end
3973+
CreateAbsencePeriodRequest:
3974+
title: Create Absence periods **tracked in hours**
3975+
type: object
3976+
properties:
3977+
employee_id:
3978+
type: integer
3979+
description: Employee identifier
3980+
example: 10735
3981+
absence_type_id:
3982+
type: string
3983+
format: uuid
3984+
description: Absence type identifier
3985+
example: 9bba303f-0fbc-4514-9958-0befa21923fb
3986+
start_date:
3987+
type: string
3988+
format: date
3989+
description: "Absence start date. Format: yyyy-mm-dd"
3990+
example: '2020-01-31'
3991+
end_date:
3992+
type: string
3993+
format: date
3994+
description: "Absence end date. Format: yyyy-mm-dd"
3995+
example: '2020-01-31'
3996+
full_day:
3997+
type: boolean
3998+
example: false
3999+
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)
4000+
start_time:
4001+
type: string
4002+
format: date
4003+
description: "Absence start time. Format: HH:mm (hours and minutes) and only required if the start_date and end_date are the same, and full_day is false (partial-day absence)"
4004+
example: '03:00'
4005+
end_time:
4006+
type: string
4007+
format: date
4008+
description: "Absence end time. Format: HH:mm (hours and minutes) and only required if the start_date and end_date are the same, and full_day is false (partial-day absence)"
4009+
example: '15:00'
4010+
half_day_start:
4011+
type: boolean
4012+
example: false
4013+
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)
4014+
half_day_end:
4015+
type: boolean
4016+
example: false
4017+
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)
4018+
comment:
4019+
type: string
4020+
example: Some Comment
4021+
description: Optional comment
4022+
skip_approval:
4023+
type: boolean
4024+
example: false
4025+
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.
4026+
required:
4027+
- employee_id
4028+
- absence_type_id
4029+
- start_date
4030+
- end_date
38314031
AbsencePeriodsResponse:
38324032
title: List All Absence Periods response
38334033
type: object
@@ -4004,6 +4204,24 @@ components:
40044204
attributes:
40054205
$ref: "#/components/schemas/Absence"
40064206

4207+
HourlyAbsencePeriodResponse:
4208+
title: Absence Periods response
4209+
type: object
4210+
allOf:
4211+
- $ref: "#/components/schemas/Response"
4212+
- type: object
4213+
properties:
4214+
data:
4215+
type: object
4216+
required:
4217+
- type
4218+
- attributes
4219+
properties:
4220+
type:
4221+
example: AbsencePeriod
4222+
attributes:
4223+
$ref: "#/components/schemas/HourlyAbsence"
4224+
40074225
Absence:
40084226
type: object
40094227
properties:
@@ -4063,6 +4281,10 @@ components:
40634281
HourlyAbsence:
40644282
type: object
40654283
properties:
4284+
id:
4285+
type: string
4286+
format: uuid
4287+
example: 61fe126b-a7b3-449a-b5ee-3865a6fcc546
40664288
measurement_unit:
40674289
type: string
40684290
example: "hours"
@@ -4099,6 +4321,9 @@ components:
40994321
status:
41004322
type: string
41014323
example: approved
4324+
timezone:
4325+
type: string
4326+
example: "Europe/Berlin"
41024327
created_by:
41034328
type: integer
41044329
example: 1
@@ -4127,6 +4352,9 @@ components:
41274352
type: string
41284353
format: uuid
41294354
example: 61fe126b-a7b3-449a-b5ee-3865a6fcc546
4355+
name:
4356+
type: string
4357+
example: Absence Type Name
41304358
AbsencePeriodBreakdown:
41314359
type: object
41324360
required:

0 commit comments

Comments
 (0)