Devices
Devices are the suite of all IOT devices available on Ticatag platform.
The device object
Attribute | Type | Description |
---|---|---|
device_id | String | Device UUID |
name | String | Device name |
type | String | Device type ; Values=[unb,ibeacon] |
status | String | Device status ; Values=[active,inactive,alert] |
image_url | String | Device picture url |
thumbnail_url | String | Device thumbnail url |
icon_name | String | Device icon or marker url |
software_version | String | Device SW version aka firmware version |
mac_address | String | Device macaddress |
secondary_mac_address | String | Device secondary mac address |
proximity_uuid | String | IBeacon proximity UUID |
major | Integer | IBeacon major |
minor | Integer | IBeacon minor |
serial_number | String | Lora dev EUI or Sigfox #ID |
last_seen | String | Device last transmission |
product | Object | Hardware product information |
product.name | String | Product name (ex : XPress, TiFiz, XTrak, etc) |
product.image_url | String | Product image url |
owner | Object | Device owner |
owner.owner_id | String | Owner UUID |
owner.email | String | Owner email |
owner.language | String | Owner language key |
organization | Object | Device organization |
organization.organization_id | String | Organization UUID |
organization.name | String | Organization name |
configuration | Object | Device configuration parameters (ex : Tracking time, Temperature threshold, etc) @See device configuration |
last_location | Object | Device last location |
last_location.timestamp | String | UTC Datetime in ISO 8601 format |
last_location.latitude | Double | Last location latitude |
last_location.longitude | Double | Last location longitude |
last_location.latitude | String | Last location formatted address |
last_battery | Object | Device last battery measure |
last_battery.timestamp | String | UTC Datetime in ISO 8601 format |
last_battery.value | Integer | Last battery value |
last_battery.unit | String | Battery unit ; Values=[percent,millivolt] |
last_temperature | Object | Device last temperature measure |
last_temperature.timestamp | String | UTC Datetime in ISO 8601 format |
last_temperature.value | Double | Last temperature value |
last_temperature.unit | String | Temperature unit ; Values=[celsius,fahrenheit] |
last_humidity | Object | Device last humidity measure |
last_humidity.timestamp | String | UTC Datetime in ISO 8601 format |
last_humidity.value | Double | Last temperature value |
last_humidity.unit | String | Humidity unit ; Values=[percent] |
last_door | Object | Device last door status |
last_door.timestamp | String | UTC Datetime in ISO 8601 format |
last_door.status | Double | Last door status ; Values=[open,closed] |
last_shock | Object | Device last shock status |
last_shock.timestamp | String | UTC Datetime in ISO 8601 format |
last_shock.status | String | Last shock status ; Values=[clear,detected] |
last_rollover | Object | Device last rollover status |
last_rollover.timestamp | String | UTC Datetime in ISO 8601 format |
last_rollover.status | String | Last rollover status ; Values=[clear,detected] |
last_motion | Object | Device last motion status |
last_motion.timestamp | String | UTC Datetime in ISO 8601 format |
last_motion.status | String | Last motion status ; Values=[still,moving] |
last_subscription | Object | Device last subscription |
last_subscription.start_date | String | Subscription start date - UTC Datetime in ISO 8601 format |
last_subscription.end_date | String | Subscription end date - UTC Datetime in ISO 8601 format |
last_subscription.status | String | Subscription status ; Values=[active,past,canceled] |
List all devices
A GET
request will return all devices owned by an organization or an user
Example request
$ curl 'https://api.ticatag.com/v2/devices' -i
Example response
HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=UTF-8
{
"_embedded" : {
"devices" : [ {
"name" : "tiBe1",
"_links" : {
"self" : {
"href" : "https://api.ticatag.com/v2/devices/b4c91680-f989-4b74-8471-93ff7c99e939"
}
}
}, {
"name" : "my tifiz",
"serial_number": "74F55",
"_links" : {
"self" : {
"href" : "https://api.ticatag.com/v2/devices/9d14185d-6b59-408a-a8fc-19630a37acfb"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://api.ticatag.com/v2/devices"
}
},
"page" : {
"size" : 25,
"total_elements" : 2,
"total_pages" : 1,
"number" : 0
}
}
Path | Type | Description |
---|---|---|
_embedded.devices | Array | List of devices |
Query parameters
You must use query parameters to filter list of devices or to request extra data in reponse.
Parameter | Description |
---|---|
type | Search devices by type ; Values = [ ibeacon, unb] ibeacon = blutooth device ; unb = LPWAN devices |
status | Search devices by status ; Values = [ active, inactive, alert] ; active = attached to an organization or an user ; inactive = not attached to organization or user ; alert = button was pressed |
mac_address | Search by mac address ; Only applicable to bluetooth devices |
minor | Search by minor ; Only application to devices that supports ibeacon protocol |
major | Search by major ; Only application to devices that supports ibeacon protocol |
q | Search for devices by name or mac address matching your query |
last_seen_since | Search for devices whom last transmission since given ; UTC Datetime in ISO 8601 format |
last_seen_until | Search for devices whom last transmission until given ; UTC Datetime in ISO 8601 format |
product | Search for devices by product (Ex : tifiz, xpress, xtrakr, etc) |
organization_id | Search for devices by organization UUID (child organizations are automatically added) |
owner_id | Search for devices by owner UUID |
last_location | Search for devices having a last location (boolean) |
last_temperature | Search for devices having a last temperature (boolean) |
last_humidity | Search for devices having a last humidity (boolean) |
last_door | Search for devices having a last door status (boolean) |
last_shock | Search for devices having a last shock status (boolean) |
last_rollover | Search for devices having a last rollover status (boolean) |
device_ids | Search for devices with given UUIDs (array) |
includes | Properties to include in response : - device_id (device UUID) - mac_address - ibeacon_identifiers (minor + major + proximity uuid) - images (image_url, thumbnail_url, icon_name) - software_version (aka firmware version) - status - type - product (product information) - owner (owner info : UUID, email, language) - organization (organization info : UUID, name) - last_location - last_battery - last_temperature - last_humidity - last_door - last_motion - last_shock - last_rollover - last_subscription - last_seen (last transmission) - configuration (device config parameters) |
Retrieve a device
A GET
request followed by UUID retrieve the details of the device
Add in the includes
query parameter the properties that you wished in response (see the list above)
Example request
$ curl 'https://api.ticatag.com/v2/devices/4171412a-9324-4a3c-8357-219f023dee0b?includes=mac_address,ibeacon_identifiers,images,status,software_version,type,product,last_location' -i
Example response
HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=UTF-8
{
"name" : "tiFiz1",
"type" : "unb",
"status" : "active",
"image_url" : "https://ticatag.com/my-tifiz-picture.png",
"thumbnail_url" : "https://ticatag.com/my-tifiz-thumb.png",
"serial_number" : "75A02",
"product" : {
"name" : "tifiz",
"image_url" : "https://ticatag.s3.amazonaws.com/cb8135b2-444c-45d7-aebb-40f16fd54f0b",
"variants" : {
"version" : "1.0"
}
},
"last_location" : {
"timestamp" : "2016-11-03T12:53:19Z",
"latitude" : 48.75897166666667,
"longitude" : -3.4674300000000002
},
"_links" : {
"self" : {
"href" : "https://api.ticatag.com/v2/devices/4171412a-9324-4a3c-8357-219f023dee0b"
}
}
}
Create a device
A POST
request create the device.
Update a device
A PATCH
request followed by UUID update the device info.
Path | Type | Description |
---|---|---|
status | String | Device status |
name | String | Device name |
software_version | String | Device name |
icon_name | String | Device icon name |
product_id | String | Device product UUID |
formatted_address | String | Device last location formatted address |
organization_id | String | Device organization UUID |