POST api/LeavePlanning

All leave planning requests are considered to be new requests and must be a POST. Do not use PUT or DELETE, rather set the ChangeType to one of Add, Change, Edit (i.e. Add if new or Change if existing) or Delete then POST the request.

Request Information

URI Parameters

(i.e.queryString parameters in the form ?param1={param1}&param2={param2})

None.

Body Parameters

LeavePlanningView
NameDescriptionTypeAdditional information
LeavePlanningId

integer

None.

ChangeType

The ChangeType for the LeavePlan. Only Add (Insert) is currently supported.

string

Required

Matching: ([^'"])*

Max length: 20

ChangeStatus

The ChangeStatus for the LeavePlan. Do not supply

string

Matching: ([^'"])*

Max length: 20

EmpCode

The EmpCode for the LeavePlan.

string

Matching: ([^'"])*

Max length: 20

LeaveType

The LeaveType for the LeavePlan. Values SickLeave, AnnualLeave, LongServiceLeave, UserDefinedLeave,

string

Required

Matching: ([^'"])*

Max length: 20

LeaveCode

The UserDefinedLeave LeaveCode for the LeavePlan.

string

Matching: ([^'"])*

LeaveReason

The Leave Reason for the LeavePlan. Leave Reason codes may be found using api/Lookups?type=LeaveReason

string

Required

Matching: ([^'"])*

Max length: 50

StartDate

The Start Date for the LeavePlan.

date

Required

EndDate

The End Date for the LeavePlan.

date

Required

Override

The Override for the LeavePlan. Must be true to for value in HoursTaken to be accepted.

boolean

Required

PayInAdvance

The Pay In Advance flag for the LeavePlan.

boolean

None.

HoursTaken

The Hours Taken for the LeavePlan required if Override is set

decimal number

None.

DaysTaken

The Days Taken for the LeavePlan may be supplied if Override is set

decimal number

None.

ReferenceNumber

A reference, ideally unique, supplied by the client to identify the leave plan

string

Matching: ([^'"])*

Max length: 20

ApiUserName

string

None.

ApiUserType

string

None.

ApiUserId

integer

None.

DatabaseType

string

None.

PayrollLink
 Token

globally unique identifier

None.

ErrorMessage

string

None.

Request Formats

application/json, text/json

Sample:
{
  "leavePlanningId": 1,
  "changeType": "sample string 1",
  "changeStatus": "sample string 2",
  "empCode": "sample string 3",
  "leaveType": "sample string 4",
  "leaveCode": "sample string 5",
  "leaveReason": "sample string 6",
  "startDate": "2024-05-19T03:15:41.8973711+10:00",
  "endDate": "2024-05-19T03:15:41.8973711+10:00",
  "override": true,
  "payInAdvance": true,
  "hoursTaken": 1.0,
  "daysTaken": 1.0,
  "referenceNumber": "sample string 10",
  "apiUserName": "sample string 11",
  "apiUserType": "sample string 12",
  "apiUserId": 13,
  "databaseType": "sample string 14",
  "payrollLinkToken": "e92fe442-a035-42e6-828b-e2b9024ca3b6",
  "errorMessage": "sample string 16"
}

application/xml, text/xml

Sample:
<LeavePlanningView xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <LeavePlanningId>1</LeavePlanningId>
  <ChangeType>sample string 1</ChangeType>
  <ChangeStatus>sample string 2</ChangeStatus>
  <EmpCode>sample string 3</EmpCode>
  <LeaveType>sample string 4</LeaveType>
  <LeaveCode>sample string 5</LeaveCode>
  <LeaveReason>sample string 6</LeaveReason>
  <StartDate>2024-05-19T03:15:41.8973711+10:00</StartDate>
  <EndDate>2024-05-19T03:15:41.8973711+10:00</EndDate>
  <Override>true</Override>
  <PayInAdvance>true</PayInAdvance>
  <HoursTaken>1</HoursTaken>
  <DaysTaken>1</DaysTaken>
  <ReferenceNumber>sample string 10</ReferenceNumber>
  <ApiUserName>sample string 11</ApiUserName>
  <ApiUserType>sample string 12</ApiUserType>
  <ApiUserId>13</ApiUserId>
  <DatabaseType>sample string 14</DatabaseType>
  <PayrollLinkToken>e92fe442-a035-42e6-828b-e2b9024ca3b6</PayrollLinkToken>
  <ErrorMessage>sample string 16</ErrorMessage>
</LeavePlanningView>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

The unique id (LeavePlanningId : integer) of the Leave Planning record created

HttpResponseMessage
NameDescriptionTypeAdditional information
Version

Version

None.

Content

HttpContent

None.

StatusCode

HttpStatusCode

None.

ReasonPhrase

string

None.

Headers

Collection of HttpResponse
 Headers

None.

RequestMessage

HttpRequestMessage

None.

IsSuccessStatus
 Code

boolean

None.