20.03.29 Time Off

The Time Off Object

Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountEmployeeTimeOffRequestIdNoGuidId of Timeoff Request32
AccountTimeOffTypeNoStringId of Timeoff Request50
RequestSubmitDateNoDateTimeSubmit Date of Timeoff Request25
StartDateNoDateTimeStart Date of Timeoff Request25
EndDateNoDateTimeEnd Date of Timeoff Request25
HoursOffNoIntegerHours of Timeoff Request10
DayOffNoIntegerDays of Timeoff Request10
ApprovalStatusNoStringStatus of Timeoff Request20
AccountProjectIdIntegerGuidProject Id of Timeoff Request10
ApprovedNoBooleanId of Timeoff Request1
RejectedNoBooleanId of Timeoff Request1

List All TimeOff

Returns a list of your all TimeOff in your UNItekTIME account.
GET /API//TimeOff

Example Request

curl "https://demo.unitektime.com/api/TimeOff" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "Content-Type: application/json" \
      -H "User-Agent: MyApp (yourname@example.com)"

Example Response

[
    {
        "AccountEmployeeTimeOffRequestId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffType": "Holiday",
        "RequestSubmitDate": "2019-01-01T00:00:00+00:00",
        "StartDate": "2019-01-01T00:00:00+00:00",
        "EndDate": "2019-01-01T00:00:00+00:00",
        "HoursOff": 8,
        "DayOff": 1,
        "ApprovalStatus": "Submitted",
        "AccountProjectId": null,
        "Approved": "No",
        "Rejected": "No"
    }
]

Retrieve a TimeOff

Retrieves the TimeOff with the given ID. Returns a TimeOff object and a 200 OK response code if a valid identifier was provided.
GET /API/TimeOff/{TimeOff_ID}

Example Request

curl "https://demo.unitektime.com/api/TimeOff/00000000-0000-0000-0000-000000000000" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "Content-Type: application/json" \
      -H "User-Agent: MyApp (yourname@example.com)"

Example Response

[
    {
        "AccountEmployeeTimeOffRequestId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffType": "Holiday",
        "RequestSubmitDate": "2019-01-01T00:00:00+00:00",
        "StartDate": "2019-01-01T00:00:00+00:00",
        "EndDate": "2019-01-01T00:00:00+00:00",
        "HoursOff": 8,
        "DayOff": 1,
        "ApprovalStatus": "Submitted",
        "AccountProjectId": null,
        "Approved": "No",
        "Rejected": "No"
    }
]

Create a TimeOff from Hours

Creates a new TimeOff. Returns Response message and a 201 Created response code if the call succeeded.
POST /API/TimeOff
Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountTimeOffTypeIdYesGuidId of Timeoff Type32
DateYesDate TimeStartDate Of TimeOff19
HoursYesDoubleTimeOff Hours11

Example Request

curl "https://demo.unitektime.com/api/TimeOff" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "User-Agent: MyApp (yourname@example.com)" \
      -X POST \
      -H "Content-Type: application/json" \
      -d "{'AccountTimeOffTypeId':00000000-0000-0000-0000-000000000000','Date':'2018-12-31','Hours':8}"

Example Response

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "message": "TimeOff Added Successfully"
  }
]

Update a TimeOff from Hours

Updates the specific TimeOff by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns Response message and a 200 OK response code if the call succeeded.
POST /API/TimeOff/{TimeOff_id}

Example Request

curl "https://demo.unitektime.com/api/TimeOff/00000000-0000-0000-0000-000000000000" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "User-Agent: MyApp (yourname@example.com)" \
      -X POST \
      -H "Content-Type: application/json" \
      -d "{'AccountTimeOffTypeId':'00000000-0000-0000-0000-000000000000','Date':'2018-12-31','Hours':16}"

Example Response

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "message": "TimeOff Updated Successfully"
  }
]

Create a TimeOff from Days

Creates a new TimeOff. Returns Response message and a 201 Created response code if the call succeeded.
POST /API//TimeOff
Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountTimeOffTypeIdYesGuidId of Timeoff Type32
DateYesDate TimeStartDate Of TimeOff19
DaysYesDoubleDays Of TimeOff11

Example Request

curl "https://demo.unitektime.com/api/TimeOff/RequestByDays" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "User-Agent: MyApp (yourname@example.com)" \
      -X POST \
      -H "Content-Type: application/json" \
      -d "{'AccountTimeOffTypeId':00000000-0000-0000-0000-000000000000','Date':'2018-12-31','Days':1.5}"

Example Response

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "message": "TimeOff Added Successfully"
  }
]

Update a TimeOff from Days

Updates the specific TimeOff by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns Response message and a 200 OK response code if the call succeeded.
POST /API/TimeOff/RequestByDays/{TimeOff_id}

Example Request

curl "https://demo.unitektime.com/api/TimeOff/RequestByDays/00000000-0000-0000-0000-000000000000" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "User-Agent: MyApp (yourname@example.com)" \
      -X POST \
      -H "Content-Type: application/json" \
      -d "{'AccountTimeOffTypeId':'00000000-0000-0000-0000-000000000000','Date':'2018-12-31','Days':2}"

Example Response

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "message": "TimeOff Updated Successfully"
  }
]

Create a TimeOff from Dates

Creates a new TimeOff. Returns Response message and a 201 Created response code if the call succeeded.
POST /API/TimeOff/RequestByDates
Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountTimeOffTypeIdYesGuidId of Timeoff Type32
StartDateYesDate TimeStartDate Of TimeOff19
EndDateYesDate TimeEmd Date Of TimeOff19

Example Request

curl "https://demo.unitektime.com/api/TimeOff/RequestByDates" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "User-Agent: MyApp (yourname@example.com)" \
      -X POST \
      -H "Content-Type: application/json" \
      -d "{'AccountTimeOffTypeId':00000000-0000-0000-0000-000000000000','StartDate':'2018-12-31','EndDate':'2019-01-01'}"

Example Response

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "message": "TimeOff Added Successfully"
  }
]

Update a TimeOff from Days

Updates the specific TimeOff by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns Response message and a 200 OK response code if the call succeeded.
POST /API/TimeOff/RequestByDates/{TimeOff_id}

Example Request

curl "https://demo.unitektime.com/api/TimeOff/RequestByDays/00000000-0000-0000-0000-000000000000" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "User-Agent: MyApp (yourname@example.com)" \
      -X POST \
      -H "Content-Type: application/json" \
      -d "{'AccountTimeOffTypeId':00000000-0000-0000-0000-000000000000','StartDate':'2018-12-31','EndDate':'2019-01-01'}"

Example Response

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "message": "TimeOff Updated Successfully"
  }
]

Delete a TimeOff

Delete a TimeOff. Returns a 200 OK response code if the call succeeded.
DELETE /API/TimeOff/{TimeOff_ID}

Example Request

curl "https://demo.unitektime.com/api/TimeOff/00000000-0000-0000-0000-000000000000" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "User-Agent: MyApp (yourname@example.com)" \
      -X DELETE \
      -H "Content-Type: application/json"

Example Response

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "message": "TimeOff Deleted Successfully"
  }
]

Retrieve a TimeOff Detail of Employee

Retrieves the TimeOff Detail with the given ID. Returns a TimeOff Detail object and a 200 OK response code if a valid values provided.
GET /API/TimeOff/Details/{AccountEmployee_ID}

Example Request

curl "https://demo.unitektime.com/api/TimeOff/details/001" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "Content-Type: application/json" \
      -H "User-Agent: MyApp (yourname@example.com)"

Example Response

[
     {
        "AccountTimeOffTypeId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffType": "Sick Leave",
        "Earned": 40.0,
        "EarnedDay": 5.0,
        "Consume": 0.0,
        "ConsumeDay": 0.0,
        "Available": 40.0,
        "AvailableDay": 5.0,
        "CarryForward": 0.0,
        "CarryForwardDay": 0.0,
        "LastEarnedDate": "2019-09-24T00:00:00+00:00",
        "AccountTimeOffPolicyId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffPolicy": "Standard",
        "IsTimeOffRequestRequired": "No"
    },
    {
        "AccountTimeOffTypeId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffType": "Paid Leaves",
        "Earned": 32.0,
        "EarnedDay": 4.0,
        "Consume": 0.0,
        "ConsumeDay": 0.0,
        "Available": 16.0,
        "AvailableDay": 2.0,
        "CarryForward": 0.0,
        "CarryForwardDay": 0.0,
        "LastEarnedDate": "2019-09-24T00:00:00+00:00",
        "AccountTimeOffPolicyId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffPolicy": "Standard",
        "IsTimeOffRequestRequired": "No"
    }
]

Retrieve a TimeOff Detail of Employee and TimeOff Type

Retrieves the TimeOff Detail with the given ID. Returns a TimeOff Detail object and a 200 OK response code if a valid values provided.
GET /API/TimeOff/Details/{AccountEmployee_ID}/{AccountTimeOffType_ID}

Example Request

curl "https://demo.unitektime.com/api/TimeOff/details/001/00000000-0000-0000-0000-000000000000" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "Content-Type: application/json" \
      -H "User-Agent: MyApp (yourname@example.com)"

Example Response

[
     {
        "AccountTimeOffTypeId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffType": "Sick Leave",
        "Earned": 40.0,
        "EarnedDay": 5.0,
        "Consume": 0.0,
        "ConsumeDay": 0.0,
        "Available": 40.0,
        "AvailableDay": 5.0,
        "CarryForward": 0.0,
        "CarryForwardDay": 0.0,
        "LastEarnedDate": "2019-09-24T00:00:00+00:00",
        "AccountTimeOffPolicyId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffPolicy": "Standard",
        "IsTimeOffRequestRequired": "No"
    }
]

Get All TimeOff Entries by Date Range

Display TimeOff Entries within Date Range. Returns a 200 OK response code if the call succeeded.
GET /API/TimeOff/GetAllTimeOffByDateRange/{Start_Date}/{End_Date}

Example Request

curl "https://demo.unitektime.com/api/TimeOff/GetAllTimeOffByDateRange/2020-01-01/2020-12-31" \
      -H "APIKey: {Your API Key}" \
      -H "AuthToken: {Your Authentication Token}" \
      -H "User-Agent: MyApp (yourname@example.com)" \
      -X GET \
      -H "Content-Type: application/json"

Example Response

[
    {
        "AccountEmployeeTimeOffRequestId": "00000000-0000-0000-0000-000000000000",
        "AccountEmployeeId": 1,
        "AccountTimeOffType": "Sick Leave",
        "RequestSubmitDate": "2020-05-18T00:00:00+00:00",
        "StartDate": "2020-06-08T00:00:00+00:00",
        "EndDate": "2020-06-08T00:00:00+00:00",
        "HoursOff": 8.0,
        "DayOff": 1.0,
        "ApprovalStatus": "Approved",
        "AccountProjectId": null,
        "Approved": "Yes",
        "Rejected": "No"
    },
    {
        "AccountEmployeeTimeOffRequestId": "00000000-0000-0000-0000-000000000000",
        "AccountEmployeeId": 2,
        "AccountTimeOffType": "Sick Leave",
        "RequestSubmitDate": "2020-05-18T00:00:00+00:00",
        "StartDate": "2020-05-18T00:00:00+00:00",
        "EndDate": "2020-05-18T00:00:00+00:00",
        "HoursOff": 8.0,
        "DayOff": 1.0,
        "ApprovalStatus": "Approved",
        "AccountProjectId": null,
        "Approved": "Yes",
        "Rejected": "No"
    }
]