Skip to navigation

Leave Record - UPSERT

View as Markdown

This API is used to create, amend, approve and cancel leave requests in BIPO. It also covers leave-with-expiry requests (for example Leave Code LWE01), and it is the API to use when you sync leave requests from an external system into BIPO.

A leave request can be identified in two ways, chosen with RespectField:

RespectFieldIdentifies a leave request byWhat you can do
R (Recommended)RecordID (single key)Blank RecordID creates a new request. A supplied RecordID amends, approves or cancels that request.
K (default when RespectField is omitted)EmployeeCode + LeaveCode + DateStart + DateEnd (legacy)Create a new request or cancel an existing one. It cannot amend.
FieldTypeRequiredDescription
InterfaceCodeStringYesBIPO-LVR
RespectFieldStringNoR or K. Default is K.
RecordIDString (GUID)ConditionalLeave request identifier. Required when RespectField = R and you amend, approve or cancel a request. Leave it blank to create a new request. Not used when RespectField = K.
EmployeeCodeStringConditionalUnique employee identifier. Required when you create a request, or when RespectField = K. Also send it when you approve a request.
LeaveCodeStringConditionalLeave Code. Required when you create a request, or when RespectField = K. Also send it when you approve a request.
DateStartDate (yyyy-mm-dd)ConditionalStart date of the leave request. Required when you create a request, or when RespectField = K.
DateEndDate (yyyy-mm-dd)ConditionalEnd date of the leave request. Required when you create a request, or when RespectField = K.
HalfStartStringConditionalRequired if Leave UnitType = D (Day). First half of the day ("AM" or "PM"). Also required when you cancel in K style.
HalfEndStringConditionalRequired if Leave UnitType = D (Day). Second half of the day ("AM" or "PM"). Also required when you cancel in K style.
TimeStartString (HH:mm)ConditionalLeave start time. Required if Leave UnitType = H (Hour).
TimeEndString (HH:mm)ConditionalLeave end time. Required if Leave UnitType = H (Hour).
ApprovalStatusStringConditionalSend "C" to cancel a leave request. Leave it out in every other case. A new request is approved automatically.
ExternalRequestIDStringNoYour own reference number for the leave request, kept in BIPO and returned by Leave Record - LIST.
DateReferenceDate (yyyy-mm-dd)ConditionalOnly for leave types that ask for a reference date (for example marriage or child-related leave).
ReferenceNameStringConditionalOnly for leave types tied to a family member or a named reference (for example marriage or child-related leave).
RemarksStringNoAdditional remarks

Note: The response returns the RecordID of every imported leave request only when RespectField = R. Keep it: it is the key for a later amend, approve, cancel or delete.

Note: ExternalRequestID is not unique. BIPO does not stop two leave requests from carrying the same value, so store the returned RecordID next to your own reference.

Note: Cancelling adds a separate cancellation record and marks the leave request as cancelled. A request that is already cancelled cannot be cancelled again.

Note: This API cannot create a leave request that waits for approval. A new request is approved as soon as it is created.

Note: To approve a leave request that is waiting for approval, send its RecordID, EmployeeCode and LeaveCode and leave ApprovalStatus out. The API user must have write access to that employee.

Note: The saved examples below show create (Recommended), amend, cancel, approve, sync from an external system, leave-with-expiry, the legacy multi-key style and the common error messages.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects a string.

Response

OK
dataobject
errorslist of any
messageslist of strings
errorCodeanyOptional