The Department Object
Object Property | Required | Object Type | Description | Max Character Length |
---|
DepartmentCode | Yes | String | Code Of Department | 20 |
DepartmentName | Yes | String | Name Of Department | 400 |
AccountDepartmentId | No | Integer | Unique Id Of Department | 10 |
CustomField1 | No | String | CustomField 1 Of Department | 2000 |
CustomField2 | No | String | CustomField 2 Of Department | 2000 |
CustomField3 | No | String | CustomField 3 Of Department | 2000 |
CustomField4 | No | String | CustomField 4 Of Department | 2000 |
CustomField5 | No | String | CustomField 5 Of Department | 2000 |
CustomField6 | No | String | CustomField 6 Of Department | 2000 |
CustomField7 | No | String | CustomField 7 Of Department | 2000 |
CustomField8 | No | String | CustomField 8 Of Department | 2000 |
CustomField9 | No | String | CustomField 9 Of Department | 2000 |
CustomField10 | No | String | CustomField 10 Of Department | 2000 |
CustomField11 | No | String | CustomField 11 Of Department | 2000 |
CustomField12 | No | String | CustomField 12 Of Department | 2000 |
CustomField13 | No | String | CustomField 13 Of Department | 2000 |
CustomField14 | No | String | CustomField 14 Of Department | 2000 |
CustomField15 | No | String | CustomField 15 Of Department | 2000 |
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 Property | Required | Object Type | Description | Max Character Length |
---|
DepartmentCode | Yes | String | Code Of Department | 20 |
DepartmentName | Yes | String | Name Of Department | 400 |
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"
}
]