20.03.26 Timeoff Types

The AccountTimeOffType Object

Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountTimeOffTypeYesStringName of Timeoff Type10
AccountTimeOffTypeIdNoGuidId of Timeoff Type32
IsTimeOffRequestRequiredNoBooleanRequest Required Status of Timeoff Type1
IsDisabledNoBooleanDisabled Status of Timeoff Type1

List All AccountTimeOffTypes

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

Example Request

curl "https://demo.unitektime.com/api/TimeOffTypes" \
      -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": "Holiday",
        "IsTimeOffRequestRequired": "No",
        "IsDisabled": "No"
    },
    {
        "AccountTimeOffTypeId": "00000000-0000-0000-0000-000000000000",
        "AccountTimeOffType": "Other",
        "IsTimeOffRequestRequired": "Yes",
        "IsDisabled": "No"
    }
]

Retrieve a AccountTimeOffType

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

Example Request

curl "https://demo.unitektime.com/api/TimeOffTypes/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": "Holiday",
        "IsTimeOffRequestRequired": "No",
        "IsDisabled": "No"
    }
]

Create a AccountTimeOffType

Creates a AccountTimeOffType in your UNItekTIME account and returns the Response Message.
POST /API/TimeOffTypes
Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountTimeOffTypeYesStringType of Timeoff Type10

Example Request

curl "https://demo.unitektime.com/api/TimeOffTypes" \
      -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 "{'AccountTimeOffType': 'demo'}"

Example Response

[
    {
        "id": "00000000-0000-0000-0000-000000000000",
        "message": "Time Off Type Added Successfully"
    }
]

Update a AccountTimeOffType

Update an AccountTimeOffType in your UNItekTIME account and returns the Response Message.
POST /API/TimeOffTypes/{AccountTimeOffType_ID}

Example Request

curl "https://demo.unitektime.com/api/TimeOffTypes/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 "{'IsDisabled': true}"

Example Response

[
    {
        "id": "00000000-0000-0000-0000-000000000000",
        "message": "Time Off Type Updated Successfully"
    }
]

Delete a AccountTimeOffType

Delete a AccountTimeOffType. Returns a 200 OK response code if the call succeeded.
DELETE /API/TimeOffTypes/{AccountTimeOffType_ID}

Example Request

curl "https://demo.unitektime.com/api/TimeOffTypes/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": "Time Off Type Deleted Successfully"
    }
]