20.03.19 Locations

The Location Object

Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountLocationYesStringLocation Name of Location50
AccountLocationIdNoIntegerId of Location11
IsDisabledNoBooleanDisabled Status of Location1

List All Locations

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

Example Request

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

Example Response

[
    {
        "AccountLocationId": 0001,
        "AccountLocation": "Default Location",
        "IsDisabled": "No"
    },
    {
        "AccountLocationId": 0002,
        "AccountLocation": "Other",
        "IsDisabled": "No"
    }
]

Retrieve a Location

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

Example Request

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

[
   {
        "AccountLocationId": 0001,
        "AccountLocation": "Default Location",
        "IsDisabled": "No"
    }
]

Create a Location

Creates a Location in your UNItekTIME account and returns the Response Message.
POST /API/Locations
Object PropertyRequiredObject TypeDescriptionMax Character Length
AccountLocationYesStringLocation Name of Location50

Example Request

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

Example Response

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

Update a Location

Update an Location in your UNItekTIME account and returns the Response Message.
POST /API/Locations/{Location_ID}

Example Request

curl "https://demo.unitektime.com/api/Locations/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 "{'AccountLocation': 'Sample'}"

Example Response

[
    {
        "id": "0001",
        "message": "Location Update Successfully"
    }
]

Delete a Location

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

Example Request

curl "https://demo.unitektime.com/api/Locations/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": "Location Deleted successfully"
    }
]