Reputation: 1
I am trying to submit a Time Off Request using the Workday API with the given Endpoint
My main problem is I fail to understand where the "id"
field is pulled from. In the API Schema I see there is a regex pattern for it and I tried to pull some values from the Prompt Values
endpoints where it made sense, but got the same errors regardless
What I tried
POST {{workday_url}}/api/absenceManagement/v1/{{workday_instance_id}}/workers/{{worker_id}}/requestTimeOff
BODY:
{
"days": [
{
"start": "2024-04-14T07:00:00.000Z",
"date": "2024-04-12T07:00:00.000Z",
"end": "2024-04-15T07:00:00.000Z",
"reason": {
"id": "string"
},
"dailyQuantity": "1",
"timeOffType": {
"descriptor":"VAC",
"id": "e2d08afc53614c37b32b31270bb8bee3"
},
"comment": "Going to a wedding",
"id": "dd817fe688db4ac7bf84e3ef79f72948",
"descriptor": "Requested via Integration"
}
]
}
RESPONSE:
{
"error": "invalid request: errors have occurred",
"errors": [
{
"error": "Invalid id for field",
"code": "S5",
"field": "reason",
"path": "days[0].reason",
"location": "Line: 8, column: 23"
},
{
"error": "Invalid id for field",
"code": "S5",
"field": "timeOffType",
"path": "days[0].timeOffType",
"location": "Line: 13, column: 23"
},
{
"error": "Invalid id for field",
"code": "S5",
"field": "days[0]",
"path": "days[0]",
"location": "Line: 16, column: 19"
}
]
}
Upvotes: 0
Views: 342
Reputation: 1789
The different ID fields are the Workday ID related to the object you are trying to reference. You can use the Integration IDs report in the Workday tenant to look these up.
For example, I think the first ID you would lookup Absence Reason in the Integration IDs report and get the correct value for Vacation. Do this with each of the ID fields. The last one may be the WID of the Integration User or whoever is leaving the comment.
Upvotes: 1