20.03.11 Cost Centers

The CostCenter Object

Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountCostCenterCodeYesStringCost Center Code of Cost Center7
AccountCostCenterYesStringName of Cost Center50
AccountCostCenterIdNoIntegerCost Center Id of Cost Center10
IsDisabledNoBooleanDisabled Status of Cost Center1

List All CostCenters

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

Example Request

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

Example Response

[
    {
        "AccountCostCenterId": 0001,
        "AccountCostCenterCode": "Default",
        "AccountCostCenter": "Default Cost Center",
        "IsDisabled": "No"
    }
]

Retrieve a CostCenter

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

Example Request

curl "https://demo.unitektime.com/api/CostCenters/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

[
    {
        "AccountCostCenterId": 0001,
        "AccountCostCenterCode": "Default",
        "AccountCostCenter": "Default Cost Center",
        "IsDisabled": "No"
    }
]

Create a CostCenter

Creates a CostCenter in your UNItekTIME account and returns the Response Message.
POST /API/CostCenters
Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountCostCenterCodeYesStringCost Center Code of Cost Center7
AccountCostCenterYesStringName of Cost Center50

Example Request

curl "https://demo.unitektime.com/api/CostCenters" \
      -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 "{'AccountCostCenterCode': 'tcc','AccountCostCenter': 'temp Cost Center'}"

Example Response

[
    {
        "id": "00000",
        "message": "Cost Center Added Successfully"
    }
]

Update a CostCenter

Update an CostCenter in your UNItekTIME account and returns the Response Message.
POST /API/CostCenters/{CostCenter_ID}

Example Request

curl "https://demo.unitektime.com/api/CostCenters/00001" \
      -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 "{'AccountCostCenter': 'temp Cost Center'}"

Example Response

[
    {
        "id": "00002",
        "message": "Cost Center Update Successfully"
    }
]

Delete a CostCenter

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

Example Request

curl "https://demo.unitektime.com/api/CostCenters/00002" \
      -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": "00002",
        "message": "Cost Center Delete Succeed"
    }
]