IAT (Intelligent Asset Tracking)

POST iat/asset

Create a new asset.

https:// [host] / iat / asset
Example
curl --request POST \
 --url https://hostname/iat/asset \
 --header 'content-type: application/json' \
 --header 'x-auth-token: 555-555-1212' \
 --header 'x-auth-user: joe.user' \
 --data '{
           "asset_type" : "1",
           "name" : "Precor Treadmill",
           "long_name" : "Precor Treadmill XHR2000"
           "visibilty" : "global",
           "serialized_id" : "1Z5551212",
           "serialized_id_label" : "VIN"
  }'
asset_type The asset type.
name Asset name.
long_name Asset long name.
visibilty The visibility should be ‘global’ or ‘local’.
serialized_id The serialized id of asset.
serialized_id_label The serialized id label of asset.
Example:

 VIN, serial_number

GET iat/asset/{asset_id}

Retrieve asset details by asset ID.

https://[host]/iat/asset/{asset_id}
Example
curl --request GET \
 --url https://hostname/iat/asset/12345 \
 --header 'content-type: application/json' \
 --header 'x-auth-token: 555-555-1212' \
 --header 'x-auth-user: joe.user'
asset_id The unique identifier of the asset to retrieve. This parameter is required.
Response On success:

{
   "asset_id": 12345,
   "asset_type": "1",
   "name": "Precor Treadmill",
   "long_name": "Precor Treadmill XHR2000",
   "visibility": "global",
   "serialized_id": "1Z5551212",
   "serialized_id_label": "VIN"
}

On failure:

{
   "error": "Invalid asset ID",
   "status": 406
}

GET iat/assets

Retrieve a list of all assets along with their properties.

https://[host]/iat/assets
Example
curl --request GET \
 --url https://hostname/iat/assets \
 --header 'content-type: application/json' \
 --header 'x-auth-token: 555-555-1212' \
 --header 'x-auth-user: joe.user'
Parameters This endpoint does not require any parameters.
Response On success:

[
   {
       "asset_id": 12345,
       "asset_type": "1",
       "name": "Precor Treadmill",
       "long_name": "Precor Treadmill XHR2000",
       "visibility": "global",
       "serialized_id": "1Z5551212",
       "serialized_id_label": "VIN"
   },
   {
       "asset_id": 12346,
       "asset_type": "2",
       "name": "Lifecycle Exercise Bike",
       "long_name": "Lifecycle GX Indoor Cycle",
       "visibility": "local",
       "serialized_id": "2Z5551213",
       "serialized_id_label": "Serial Number"
   }
]

On failure:

{
   "error": "Unable to fetch assets",
   "status": 500
}

PUT iat/asset/{asset_id}

Update an existing asset’s details.

https://[host]/iat/asset/{asset_id}
Example
curl --request PUT \
 --url https://hostname/iat/asset/12345 \
 --header 'content-type: application/json' \
 --header 'x-auth-token: 555-555-1212' \
 --header 'x-auth-user: joe.user' \
 --data '{
           "name": "Updated Treadmill",
           "long_name": "Updated Precor Treadmill XHR2000"
  }'
Path Parameter
  • asset_id (integer, required): The ID of the asset to update.
Body Parameters
  • name (string, required): Updated name of the asset.
  • long_name (string, required): Updated long name of the asset.
Response On success:

{
   "asset_id": 12345,
   "name": "Updated Treadmill",
   "long_name": "Updated Precor Treadmill XHR2000",
   "visibility": "global",
   "serialized_id": "1Z5551212",
   "serialized_id_label": "VIN"
}

On failure:

{
   "error": "Invalid parameters",
   "status": 400
}

DELETE iat/asset/{asset_id}

Delete an existing asset.

https://[host]/iat/asset/{asset_id}
Example
curl --request DELETE \
 --url https://hostname/iat/asset/12345 \
 --header 'x-auth-token: 555-555-1212' \
 --header 'x-auth-user: joe.user'
Path Parameter
  • asset_id (integer, required): The ID of the asset to delete.
Response On success:

{
   "message": "Asset successfully deleted",
   "asset_id": 12345
}

On failure:

{
   "error": "Asset not found or cannot be deleted",
   "status": 400
}

POST iat/assetType

Create a new asset type.

https://[host]/iat/assetType
Example
curl --request POST \
--url https://hostname/iat/assetType \
--header 'x-auth-token: 555-555-1212' \
--header 'x-auth-user: joe.user' \
--header 'Content-Type: application/json' \
--data '{
"name": "Precor Treadmill",
"long_name": "Precor Treadmill XHR2000",
"schema_table": "schema.some_table_name",
"is_ip_addressable": 1
}'
name A brief label describing the asset type.
long_name A detailed description of the asset type.
schema_table Schema table name, e.g., “schema.some_table_name”.
is_ip_addressable Set to 1 if the asset type is IP addressable, otherwise 0.

GET iat/assetType/{asset_type_id}

Retrieve asset type details by ID or list all asset types.

https://[host]/iat/assetType/{asset_type_id}
Example
curl --request GET \
  --url https://hostname/iat/assetType/{asset_type_id} \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json'
Request Parameters
  • asset_type_id (integer, optional): ID of the specific asset type to retrieve. If omitted, returns all asset types.
Response On success:

{
    "status": "success",
    "data": {
        "id": 123,
        "name": "Precor Treadmill",
        "long_name": "Precor Treadmill XHR2000",
        "schema_table": "schema.some_table_name",
        "is_ip_addressable": 1
    }
}

On failure:

{
    "error": "Asset type not found.",
    "status": 404
}

PUT iat/assetType/{asset_type_id}

Update an existing asset type by ID.

https://[host]/iat/assetType/{asset_type_id}
Example
curl --request PUT \
  --url https://hostname/iat/assetType/{asset_type_id} \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Updated Treadmill",
    "long_name": "Updated Precor Treadmill XHR2000",
    "schema_table": "schema.updated_table",
    "is_ip_addressable": 1
}'
asset_type_id ID of the asset type to update.
name New name of the asset type.
long_name New long description of the asset type.
schema_table Updated schema table name.
is_ip_addressable Set to 1 if the asset type is IP addressable, otherwise 0.
Response On success:

{
    "status": "success",
    "message": "Asset type updated successfully.",
    "data": {
        "id": 123,
        "name": "Updated Treadmill",
        "long_name": "Updated Precor Treadmill XHR2000",
        "schema_table": "schema.updated_table",
        "is_ip_addressable": 1
    }
}

On failure:

{
    "error": "Asset type not found or invalid parameters.",
    "status": 400
}

DELETE iat/assetType

Delete an existing asset type by ID.

https://[host]/iat/assetType
Example
curl --request DELETE \
  --url https://hostname/iat/assetType \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json' \
  --data '{
    "asset_type_id": 123
}'
Request Parameters
  • asset_type_id (integer, required): ID of the asset type to delete.
Response On success:

{
    "status": "success",
    "message": "Asset type deleted successfully.",
    "data": {
        "id": 123,
        "name": "Precor Treadmill",
        "long_name": "Precor Treadmill XHR2000",
        "schema_table": "schema.some_table_name",
        "is_ip_addressable": 1
    }
}

On failure:

{
    "error": "Asset type not found.",
    "status": 404
}

POST iat/custody

Create a custody history entry for an asset.

https://[host]/iat/custody
Example
curl --request POST \
  --url https://hostname/iat/custody \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json' \
  --data '{
            "asset_id": 123,
            "user_id": 456,
            "location_id": 789,
            "iat_custody_type_id": 1
}'
asset_id The ID of the asset.
user_id The ID of the user responsible for the asset.
location_id The ID of the location where the asset is stored.
iat_custody_type_id Custody type ID (1, 2, or 3). Refer to the `vfadmin.iat_custody_types` table for possible values.
Response On success:

{
    "status": "success",
    "message": "Custody history created successfully.",
    "data": {
        "asset_id": 123,
        "user_id": 456,
        "location_id": 789,
        "iat_custody_type_id": 1,
        "created_at": "2024-11-25T12:00:00"
    }
}

On failure:

{
    "error": "Invalid asset_id, user_id, location_id, or custody type.",
    "status": 400
}

GET iat/custody

Retrieve custody history for an asset.

https://[host]/iat/custody?asset_id={asset_id}
Example
curl --request GET \
  --url https://hostname/iat/custody?asset_id=123 \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json'
Request Parameters
  • asset_id (integer, required): The ID of the asset for which you want to retrieve custody history.
Response On success:

{
    "status": "success",
    "message": "Custody history retrieved successfully.",
    "data": [
        {
            "asset_id": 123,
            "user_id": 456,
            "location_id": 789,
            "iat_custody_type_id": 1,
            "created_at": "2024-11-25T12:00:00"
        },
        {
            "asset_id": 123,
            "user_id": 987,
            "location_id": 654,
            "iat_custody_type_id": 2,
            "created_at": "2024-11-20T15:00:00"
        }
    ]
}

On failure:

{
    "error": "Invalid asset_id.",
    "status": 400
}

POST iat/custodyType

Create a new asset custody type.

https://[host]/iat/custodyType
Example
curl --request POST \
  --url https://hostname/iat/custodyType \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json' \
  --data '{
        "name": "New Custody Type"
    }'
name The name of the custody type to be created.
Response On success:

{
    "status": "success",
    "message": "Custody type created successfully.",
    "data": {
        "id": 1,
        "name": "New Custody Type"
    }
}

On failure:

{
    "error": "Invalid name.",
    "status": 400
}

GET iat/custodyType

Retrieve all asset custody types.

https://[host]/iat/custodyType
Example
curl --request GET \
  --url https://hostname/iat/custodyType \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json'
Response On success:

{
    "status": "success",
    "message": "Custody types retrieved successfully.",
    "data": [
        {
            "id": 1,
            "name": "Custody Type 1"
        },
        {
            "id": 2,
            "name": "Custody Type 2"
        }
    ]
}

On failure:

{
    "error": "No custody types found.",
    "status": 404
}

GET iat/activityHistory

Get the asset activity history report within a specified date range (maximum 90 days).

https://[host]/iat/activityHistory?start_date={start_date};end_date={end_date}
Example
curl --request GET \
  --url 'https://hostname/iat/activityHistory?start_date=2024-10-01&end_date=2024-11-01' \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json'
Request Parameters
  • start_date (string, optional): Start date in YYYY-MM-DD format. Defaults to 30 days ago if not provided.
  • end_date (string, optional): End date in YYYY-MM-DD format. Defaults to today if not provided.
Response On success:

{
    "status": "success",
    "message": "Activity history retrieved successfully.",
    "data": [
        {
            "asset_id": 123,
            "activity": "Moved to location X",
            "date": "2024-10-15"
        },
        {
            "asset_id": 123,
            "activity": "Assigned to user Y",
            "date": "2024-10-17"
        }
    ]
}

On failure:

{
    "error": "Invalid date range.",
    "status": 400
}

GET iat/assetPhotos

Retrieve all photos associated with an asset.

https://[host]/iat/assetPhotos?asset_id={asset_id}
Example
curl --request GET \
  --url https://hostname/iat/assetPhotos_get?asset_id=123 \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --header 'Content-Type: application/json'
Request Parameters
  • asset_id (integer, required): The ID of the asset for which you want to retrieve photos.
Response On success:

{
    "status": "success",
    "message": "Photos retrieved successfully.",
    "data": [
        {
            "photo_id": 1,
            "photo_url": "https://hostname/photos/asset_123_photo1.jpg"
        },
        {
            "photo_id": 2,
            "photo_url": "https://hostname/photos/asset_123_photo2.jpg"
        }
    ]
}

On failure:

{
    "error": "No photos found.",
    "status": 404
}

POST iat/assetRelationship

Create a parent-child relationship between assets.

https://[host]/iat/assetRelationship
Example
curl --request POST \
  --url https://hostname/iat/asset_relationship_post \
  --header 'Content-Type: application/json' \
  --header 'x-auth-token: 555-555-1212' \
  --header 'x-auth-user: joe.user' \
  --data '{
   "parent_id": 123,
   "child_id": 456,
   "rel_id": 789
}'
parent_id The parent asset ID.
child_id The child asset ID.
rel_id The relationship type ID.
Response On success:

{
    "status": "success",
    "message": "Asset relationship created successfully.",
    "data": {
        "parent_id": 123,
        "child_id": 456,
        "rel_id": 1
    }
}

On failure:

{
    "error": "Invalid parameters.",
    "status": 400
}

DELETE iat/asset_relationship

Delete (deactivate) a parent-child relationship if it exists. If not, a 422 response code will be issued.

https://[host]/iat/asset_relationship
Example
curl --request DELETE \
          --url https://hostname/iat/asset_relationship \
           --header 'x-auth-token: 555-555-1212' \
           --header 'x-auth-user: joe.user' \
           --data '{
                   "parent_id": 123,
                   "child_id": 456
            }'
parent_id The ID of the parent asset in the relationship.
child_id The ID of the child asset in the relationship.
Response On success:

{
   "message": "Relationship successfully deleted",
   "parent_id": 123,
   "child_id": 456
}

On failure:

{
   "error": "Relationship not found or cannot be deleted",
   "status": 422
}

GET iat/asset_relationships

Retrieve a list of asset relationships.

https://[host]/iat/asset_relationships
Example
curl --request GET \
--url https://hostname/iat/asset_relationships?limit=150 \
--header 'x-auth-token: 555-555-1212' \
--header 'x-auth-user: joe.user'
Query Parameter
  • limit (integer, optional): The number of rows to retrieve, default is 150.
Response On success:

[
   {
       "parent_id": 123,
       "child_id": 456,
       "rel_id": 789,
       "created_at": "2024-01-01T00:00:00Z"
   },
   {
       "parent_id": 124,
       "child_id": 457,
       "rel_id": 790,
       "created_at": "2024-01-02T00:00:00Z"
   }
]

On failure:

{
   "error": "Unable to retrieve relationships",
   "status": 500
}