20.03.27 Work Types

The Worktype Object

Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountWorkTypeCodeYesStringCode of Worktype10
AccountWorkTypeYesStringName of Worktype10
AccountWorkTypeIdNoGuidId of Worktype32
IsDisabledNoBooleanDisabled Status of Worktype1

List All Worktypes

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

Example Request

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

Example Response

[
     {
        "AccountWorkTypeId": 0001,
        "AccountWorkTypeCode": "ST",
        "AccountWorkType": "Standard",
        "IsDisabled": "No"
    },
    {
        "AccountWorkTypeId": 0002,
        "AccountWorkTypeCode": "OT",
        "AccountWorkType": "Overtime",
        "IsDisabled": "No"
    }
]

Retrieve a Worktype

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

Example Request

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

Example Response

[
     {
        "AccountWorkTypeId": 0001,
        "AccountWorkTypeCode": "ST",
        "AccountWorkType": "Standard",
        "IsDisabled": "No"
    }
]

Create a Worktype

Creates a Worktype in your UNItekTIME account and returns the Response Message.
POST /API/Worktypes
Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountWorkTypeCodeYesStringCode of Worktype10
AccountWorkTypeYesStringName of Worktype10

Example Request

curl "https://demo.unitektime.com/api/Worktypes" \
      -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 "{'AccountWorkTypeCode': 'dm',''AccountWorkType': 'demo'}"

Example Response

[
    {
        "id": "0001",
        "message": "Work Type Added Successfully"
    }
]

Update a Worktype

Update an Worktype in your UNItekTIME account and returns the Response Message.
POST /API/Worktypes/{Worktypes_ID}

Example Request

curl "https://demo.unitektime.com/api/Worktypes/0001" \
      -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": "0001",
        "message": "Work Type Updated Successfully"
    }
]

Delete a Worktype

Delete a Worktype. Returns a 200 OK response code if the call succeeded.
DELETE /API/Worktypes/{Worktypes_ID}

Example Request

curl "https://demo.unitektime.com/api/Worktypes/0001" \
      -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": "0001",
        "message": "Work Type Deleted Successfully"
    }
]