20.03.01 Departments

The Department Object

Object PropertyRequiredObject TypeDescriptionMax Character Length
DepartmentCodeYesStringCode Of Department20
DepartmentNameYesStringName Of Department400
AccountDepartmentIdNoIntegerUnique Id Of Department10
CustomField1NoStringCustomField 1 Of Department2000
CustomField2NoStringCustomField 2 Of Department2000
CustomField3NoStringCustomField 3 Of Department2000
CustomField4NoStringCustomField 4 Of Department2000
CustomField5NoStringCustomField 5 Of Department2000
CustomField6NoStringCustomField 6 Of Department2000
CustomField7NoStringCustomField 7 Of Department2000
CustomField8NoStringCustomField 8 Of Department2000
CustomField9NoStringCustomField 9 Of Department2000
CustomField10NoStringCustomField 10 Of Department2000
CustomField11NoStringCustomField 11 Of Department2000
CustomField12NoStringCustomField 12 Of Department2000
CustomField13NoStringCustomField 13 Of Department2000
CustomField14NoStringCustomField 14 Of Department2000
CustomField15NoStringCustomField 15 Of Department2000

List All Departments

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

Example Request

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

Example Response

[
  {
        "AccountDepartmentId": 1,
        "DepartmentCode": "Default",
        "DepartmentName": "Default Department",
        "CustomField1": null,
        "CustomField2": null,
        "CustomField3": null,
        "CustomField4": null,
        "CustomField5": null,
        "CustomField6": null,
        "CustomField7": null,
        "CustomField8": null,
        "CustomField9": null,
        "CustomField10": null,
        "CustomField11": null,
        "CustomField12": null,
        "CustomField13": null,
        "CustomField14": null,
        "CustomField15": null
    }
]

Retrieve an Department

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

Example Request

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

Example Response

[
  {
        "AccountDepartmentId": 1,
        "DepartmentCode": "Default",
        "DepartmentName": "Default Department",
        "CustomField1": null,
        "CustomField2": null,
        "CustomField3": null,
        "CustomField4": null,
        "CustomField5": null,
        "CustomField6": null,
        "CustomField7": null,
        "CustomField8": null,
        "CustomField9": null,
        "CustomField10": null,
        "CustomField11": null,
        "CustomField12": null,
        "CustomField13": null,
        "CustomField14": null,
        "CustomField15": null
    }
]

Create an Department

Creates an Department in your UNItekTIME account and returns the Response Message.
POST /API/Departments
Object PropertyRequiredObject TypeDescriptionMax Character Length
DepartmentCodeYesStringCode Of Department20
DepartmentNameYesStringName Of Department400

Example Request

curl "https://demo.unitektime.com/api/Departments" \
      -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 "{'DepartmentCode':'demo','DepartmentName':'Demo Department'}"

Example Response

[            
    {            
        "id": "00001",            
        "message": "Department Added Successfully"            
    }            
]

Update an Department

Update an Department in your UNItekTIME account and returns the Response Message.
POST /API/Departments/{Department_ID}

Example Request

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

Example Response

[            
    {            
        "id": "00003",            
        "message": "Department Updated Successfully"            
    }            
]

Delete an Department

Delete an Department. Returns a 200 OK response code if the call succeeded.
DELETE /API/Department/{Department_ID}

Example Request

curl "https://demo.unitektime.com/api/Departments/00003" \
      -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": "00003",
        "message": "Department Deleted Successfully"
    }
]