DAPAGEE IIoT Platform API documentation version v2
https://dapagee.io/{version}
- version: required (v2)
Welcome
The DAPAGEE IIoT Platform RESTful API uses JSON Web Tokens (JWT) to authenticate each request. Each secured request requires the following 2 HTTP headers:
x-client-id: [client ID]
x-access-token: [jwt]
As we are only in alpha right now, only partners can get a login. If you are a partner, please contact Darryl Patterson. Please see the AUTHENTICATION documentation to find out how to get your JWT.
AUTHENTICATION
Pass on the email address and password as JSON. The system will return a JWT that will be used for future secured API requests.
If there is an issue with the client ID or JWT, the system will return an error as a JSON document. Here are the two possible error responses:
HTTP status code 401
{
message: 'The supplied x-access-token (JWT) is not valid.'
}
HTTP status code 401
{
message: 'One or both of the required headers (x-client-id, x-access-token) are missing.'
}
Authenticates the user and returns a JSON Web Token.
post /authentication
Authenticates the user and returns a JSON Web Token.
Body
Media type: application/json
Type: object
Example:
{
"email": "john@example.com",
"password": "super_secret"
}
HTTP status code 200
Authenticate was successful.
Body
Media type: application/json
Type: object
Example:
{
"message": "Authentication successful.",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"
}
HTTP status code 404
The email and/or the password were incorrect.
Body
Media type: application/json
Type: object
Example:
{
"message": "Authentication failed. User not found."
}
HTTP status code 409
There is no client associated with the user. Contact Darryl to get this fixed.
Body
Media type: application/json
Type: object
Example:
{
"message": "No client associated with user."
}
ASSETS
Lets you manipulate assets.
Gets a single asset.
Updates an asset.
get /assets/{asset_id}
Gets a single asset.
URI Parameters
- asset_id: required (string)
The asset's ObjectId.
HTTP status code 200
Gets a single asset.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"tagCode": "STRING",
"name": "STRING",
"description": "STRING",
"location": {
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"],
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
}
}
}
put /assets/{asset_id}
Updates an asset.
URI Parameters
- asset_id: required (string)
The asset's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"tagCode": "STRING",
"name": "STRING",
"description": "STRING",
"location": "OBJECT_ID"
}
HTTP status code 200
Asset updated.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"tagCode": "STRING",
"name": "STRING",
"description": "STRING",
"location": {
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"],
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
}
}
}
Allows you to get and alter the settings for a asset.
get /assets/{asset_id}/settings
Allows you to get and alter the settings for a asset.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- asset_id: required (string)
The asset's ObjectId.
HTTP status code 200
Returns an array of the setting names (key).
Body
Media type: application/json
Type: object
Example:
[{
"key": "pressure-interval",
"name": "pressure-interval",
"datatype": "int",
"range": "MIXED",
"value": "MIXED"
},{
"key": "battery-interval",
"name": "battery-interval",
"datatype": "int",
"range": "MIXED",
"value": "MIXED"
},{
"key": "temperature-interval",
"name": "temperature-interval",
"datatype": "int",
"range": "MIXED",
"value": "MIXED"
},{
"key": "connect-interval",
"name": "connect-interval",
"datatype": "int",
"range": "MIXED",
"value": "MIXED"
},{
"key": "high-limit",
"name": "high-limit",
"datatype": "double",
"range": "MIXED",
"value": "MIXED"
},{
"key": "low-limit",
"name": "low-limit",
"datatype": "double",
"range": "MIXED",
"value": "MIXED"
},{
"key": "dead-band",
"name": "dead-band",
"datatype": "double",
"range": "MIXED",
"value": "MIXED"
},{
"key": "pre-roll",
"name": "pre-roll",
"datatype": "int",
"range": "MIXED",
"value": "MIXED"
},{
"key": "post-roll",
"name": "post-roll",
"datatype": "int",
"range": "MIXED",
"value": "MIXED"
},{
"key": "start-time",
"name": "start-time",
"datatype": "date",
"range": "MIXED",
"value": "MIXED"
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets an individual setting for an asset. The key is validated from the associated device settings.
Allows you to set an individual setting for an asset. All valures are posted as STRING. The value is cast based on setting data type and is validated from the associated settings range if present.
get /assets/{asset_id}/settings/{setting_key}
Gets an individual setting for an asset. The key is validated from the associated device settings.
URI Parameters
- asset_id: required (string)
The asset's ObjectId.
- setting_key: required (string)
HTTP status code 200
Returns the setting details.
Body
Media type: application/json
Type: object
Example:
{
"key": "STRING",
"name": "STRING",
"datatype": "STRING",
"range": "MIXED",
"value": "MIXED"
}
put /assets/{asset_id}/settings/{setting_key}
Allows you to set an individual setting for an asset. All valures are posted as STRING. The value is cast based on setting data type and is validated from the associated settings range if present.
URI Parameters
- asset_id: required (string)
The asset's ObjectId.
- setting_key: required (string)
Body
Media type: application/json
Type: object
Example:
{
"name": "STRING",
"value": "80"
}
HTTP status code 200
Returns the new setting details.
Body
Media type: application/json
Type: object
Example:
{
"key": "STRING",
"name": "STRING",
"value": "MIXED"
}
Gets an array of devices attached to this asset.
get /assets/{asset_id}/devices
Gets an array of devices attached to this asset.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- asset_id: required (string)
The asset's ObjectId.
HTTP status code 200
Returns an array of devices.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"serialNumber": "STRING",
"type": "STRING",
"description": "STRING",
"sensors":[{
"tagCode": "STRING",
"type": "NUMBER",
"typeString": "STRING",
"description": "STRING",
"unit": "STRING"
}]
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Adds this device to this asset.
post /assets/{asset_id}/devices/{device_id}/add
Adds this device to this asset.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- asset_id: required (string)
The asset's ObjectId.
- device_id: required (string)
The device's ObjectId.
HTTP status code 200
Deviced added to asset.
Body
Media type: application/json
Type: object
Example:
{
"message": "Device added."
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Removes this device from this asset.
delete /assets/{asset_id}/devices/{device_id}/remove
Removes this device from this asset.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- asset_id: required (string)
The asset's ObjectId.
- device_id: required (string)
HTTP status code 200
Deviced removed from asset.
Body
Media type: application/json
Type: object
Example:
{
"message": "Device removed."
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
CLIENTS
Lets you manipulate and access client data and telemetry tags.
Allows you to get a list of the clients you are allowed to access based on the user's role. If the user belongs to a company that's a reseller, an array of the reseller's clients is returned.
Allows you to add a new client. You must be a reseller or be an admin to add a new client.
get /clients
Allows you to get a list of the clients you are allowed to access based on the user's role. If the user belongs to a company that's a reseller, an array of the reseller's clients is returned.
A JSON Web Token & Client ID must be sent in the request header.
HTTP status code 200
Returns an array of clients.
Body
Media type: application/json
Type: object
Example:
[
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"apikey": {
"id": "STRING"
},
"tagCode": "STRING",
"companyName": "STRING",
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
},
"contact": {
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"phone": "STRING"
},
"reseller": "BOOLEAN"
}
]
HTTP status code 400
Database error adding the client.
Body
Media type: application/json
Type: object
Example:
{
"message": "Error inserting the client: [ERROR_MESSAGE]"
}
HTTP status code 401
Not authorized.
Body
Media type: application/json
Type: object
Example:
{
"message": "You are not authorized to access this resource."
}
HTTP status code 404
Client not found.
Body
Media type: application/json
Type: object
Example:
{
"message": "Client not found"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
post /clients
Allows you to add a new client. You must be a reseller or be an admin to add a new client.
A JSON Web Token & Client ID must be sent in the request header.
Annotations
- role
"ADMIN"
Body
Media type: application/json
Type: object
Example:
{
"message": "Client added",
"_id": "OBJECT_ID"
}
HTTP status code 200
Returns the added client.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"apikey": {
"id": "STRING"
},
"tagCode": "STRING",
"companyName": "STRING",
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
},
"contact": {
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"phone": "STRING"
},
"reseller": "BOOLEAN"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to work with an individual client.
Returns a single client.
Allows you to edit a client. All fields are optional. You cannot change a password with this endpoint (see USERS endpoint).
get /clients/{client_id}
Returns a single client.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
Returns a client.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"apikey": {
"id": "STRING"
},
"tagCode": "STRING",
"companyName": "STRING",
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
},
"contact": {
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"phone": "STRING"
},
"reseller": "BOOLEAN"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
put /clients/{client_id}
Allows you to edit a client. All fields are optional. You cannot change a password with this endpoint (see USERS endpoint).
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"tagCode": "STRING",
"companyName": "STRING",
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
},
"contact": {
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"phone": "STRING"
},
"reseller": "BOOLEAN"
}
HTTP status code 200
Client saved.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"apikey": {
"id": "STRING"
},
"tagCode": "STRING",
"companyName": "STRING",
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
},
"contact": {
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"phone": "STRING"
},
"reseller": "BOOLEAN"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to work with a client's alerts.
Allows you to add an alert.
get /clients/{client_id}/alerts
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
Gets a list of the client's alerts.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"assets": ["OBJECT_ID]",
"sensor": "OBJECT_ID",
"alertGroupCodes": ["STRING"],
"active": "BOOLEAN",
"frequencyMinutes": "NUMBER",
"limits": {
"low": "NUMBER",
"high": "NUMBER"
}
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
post /clients/{client_id}/alerts
Allows you to add an alert.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"assets": ["OBJECT_ID]",
"sensor": "OBJECT_ID",
"alertGroupCodes": ["STRING"],
"active": "BOOLEAN",
"frequencyMinutes": "NUMBER",
"limits": {
"low": "NUMBER",
"high": "NUMBER"
}
}
HTTP status code 200
Alert added.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"assets": ["OBJECT_ID]",
"sensor": "OBJECT_ID",
"alertGroupCodes": ["STRING"],
"active": "BOOLEAN",
"frequencyMinutes": "NUMBER",
"limits": {
"low": "NUMBER",
"high": "NUMBER"
}
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to work with an individual alert.
Allows you to edit an alert.
get /clients/{client_id}/alerts/{alert_id}
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
- alert_id: required (string)
The alert group's code.
HTTP status code 200
Get's a single alert.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"assets": ["OBJECT_ID]",
"sensor": "OBJECT_ID",
"alertGroupCodes": ["STRING"],
"active": "BOOLEAN",
"frequencyMinutes": "NUMBER",
"limits": {
"low": "NUMBER",
"high": "NUMBER"
}
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
put /clients/{client_id}/alerts/{alert_id}
Allows you to edit an alert.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
- alert_id: required (string)
The alert group's code.
Body
Media type: application/json
Type: object
Example:
{
"assets": ["OBJECT_ID]",
"sensor": "OBJECT_ID",
"alertGroupCodes": ["STRING"],
"active": "BOOLEAN",
"frequencyMinutes": "NUMBER",
"limits": {
"low": "NUMBER",
"high": "NUMBER"
}
}
HTTP status code 200
Alert saved.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"assets": ["OBJECT_ID]",
"sensor": "OBJECT_ID",
"alertGroupCodes": ["STRING"],
"active": "BOOLEAN",
"frequencyMinutes": "NUMBER",
"limits": {
"low": "NUMBER",
"high": "NUMBER"
}
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
delete /clients/{client_id}/alerts/{alert_id}
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
- alert_id: required (string)
The alert group's code.
HTTP status code 200
Removes an alert.
Body
Media type: application/json
Type: object
Example:
{
"message": "Alert has been removed."
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to work with a client's alert groups.
Allows you to add an alert group. Code must be unique per client.
get /clients/{client_id}/alertgroups
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
Get's a list of the client's alert groups.
Body
Media type: application/json
Type: object
Example:
[{
"code": "STRING",
"name": "STRING",
"contacts": [{
"name": "STRING",
"sms": {
"send": "BOOLEAN",
"number": "STRING"
},
"email": {
"send": "BOOLEAN",
"address": "STRING"
},
"user": {
"send": "BOOLEAN",
"id": "OBJECT_ID"
}
}]
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
post /clients/{client_id}/alertgroups
Allows you to add an alert group. Code must be unique per client.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"code": "STRING",
"name": "STRING",
"contacts": [{
"name": "STRING",
"sms": {
"send": "BOOLEAN",
"number": "STRING"
},
"email": {
"send": "BOOLEAN",
"address": "STRING"
},
"user": {
"send": "BOOLEAN",
"id": "OBJECT_ID"
}
}]
}
HTTP status code 200
Alert group added.
Body
Media type: application/json
Type: object
Example:
[{
"code": "STRING",
"name": "STRING",
"contacts": [{
"name": "STRING",
"sms": {
"send": "BOOLEAN",
"number": "STRING"
},
"email": {
"send": "BOOLEAN",
"address": "STRING"
},
"user": {
"send": "BOOLEAN",
"id": "OBJECT_ID"
}
}]
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to work with an individual alert group.
Allows you to edit an alert group.
get /clients/{client_id}/alertgroups/{code}
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
- code: required (string)
The alert group's code.
HTTP status code 200
Get's a single alert group.
Body
Media type: application/json
Type: object
Example:
{
"code": "STRING",
"name": "STRING",
"contacts": [{
"name": "STRING",
"sms": {
"send": "BOOLEAN",
"number": "STRING"
},
"email": {
"send": "BOOLEAN",
"address": "STRING"
},
"user": {
"send": "BOOLEAN",
"id": "OBJECT_ID"
}
}]
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
put /clients/{client_id}/alertgroups/{code}
Allows you to edit an alert group.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
- code: required (string)
The alert group's code.
Body
Media type: application/json
Type: object
Example:
{
"name": "STRING",
"contacts": [{
"name": "STRING",
"sms": {
"send": "BOOLEAN",
"number": "STRING"
},
"email": {
"send": "BOOLEAN",
"address": "STRING"
},
"user": {
"send": "BOOLEAN",
"id": "OBJECT_ID"
}
}]
}
HTTP status code 200
Alert group saved.
Body
Media type: application/json
Type: object
Example:
{
"code": "STRING",
"name": "STRING",
"contacts": [{
"name": "STRING",
"sms": {
"send": "BOOLEAN",
"number": "STRING"
},
"email": {
"send": "BOOLEAN",
"address": "STRING"
},
"user": {
"send": "BOOLEAN",
"id": "OBJECT_ID"
}
}]
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
delete /clients/{client_id}/alertgroups/{code}
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
- code: required (string)
The alert group's code.
HTTP status code 200
Removes an alert group.
Body
Media type: application/json
Type: object
Example:
{
"message": "Alert group has been removed."
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets a list of the client's assets.
Add an asset to the client.
get /clients/{client_id}/assets
Gets a list of the client's assets.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
An array of assets.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"tagCode": "STRING",
"name": "STRING",
"description": "STRING",
"settings": [],
"location": {
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"],
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
}
}
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
post /clients/{client_id}/assets
Add an asset to the client.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"tagCode": "STRING",
"name": "STRING",
"description": "STRING",
"settings": [],
"location": "OBJECT_ID"
}
HTTP status code 200
Asset added.
Body
Media type: application/json
Type: object
Example:
{
"message": "Added added",
"_id": "OBJECT_ID"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets a list of the client's events (pressure & accoustic).
get /clients/{client_id}/events
Gets a list of the client's events (pressure & accoustic).
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
Returns the list of events.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"type": "STRING",
"tag": "STRING",
"description": "STRING",
"start": "DATE",
"end": "END",
"count": "NUMBER"
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets a list of the client's tags.
get /clients/{client_id}/tags
Gets a list of the client's tags.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
Returns the available tags for the client.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"description": {
"location": "STRING",
"asset": "STRING",
"sensor": "STRING"
},
"tag": {
"full": "STRING",
"clientTagCode": "STRING",
"locationTagCode": "STRING",
"assetTagCode": "STRING",
"sensorTagCode": "STRING"
},
"active": "BOOLEAN",
"activeStart": "DATE",
"history": {
"start": "DATE",
"end": "DATE",
"device_id": "OBJECT_ID"
}
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to search multiple tags. Returns an array of telemetry data.
Queries for telemetry using tags.
get /clients/{client_id}/telemetries/search
Queries for telemetry using tags.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
Query Parameters
- tags: required (string)
A comma delimited list of tags.
Example:
tags=D001_LOC1_TI,D002_LOC1_EI
- start: required (string)
The start date of the data.
Example:
start=2016-01-29T16:04:27.000Z
- end: required (string)
The end date of the data.
Example:
end=2016-01-29T16:04:27.000Z
- asset: (string)
A flag to include asset data.
Example:
asset=1
- device: (string)
A flag to include device data.
Example:
device=1
- sensor: (string)
A flag to include sensor data.
Example:
sensor=1
HTTP status code 200
Returns an array of telemetry data. The data represents the state of the system when the telemetry was captured (asset, device and sensor are copied data).
Body
Media type: application/json
Type: object
Example:
[
{
"tag": "STRING",
"timestamp": "DATE",
"asset": {
"tagCode": "STRING",
"name": "STRING",
"description": "STRING",
"location": {
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"]
}
},
"device": {
"serialNumber": "STRING",
"type": "STRING",
"description": "STRING"
},
"sensor": {
"type": "NUMBER",
"typeString": "STRING",
"description": "STRING",
"unit": "STRING"
},
"data": {
"unit": "STRING",
"values": {
"min": "NUMBER",
"max": "NUMBER",
"average": "NUMBER",
"current": "NUMBER"
}
}
}
]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets an array of locations.
Adds a new location to the client.
get /clients/{client_id}/locations
Gets an array of locations.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
Returns an array of locations for this client.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"],
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
}
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
post /clients/{client_id}/locations
Adds a new location to the client.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"message": "Location added",
"_id": "OBJECT_ID"
}
HTTP status code 200
Location added.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"],
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
}
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets an array of the client's devices.
get /clients/{client_id}/devices
Gets an array of the client's devices.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
An array of devices.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"serialNumber": "STRING",
"type": "STRING",
"tagCode": "STRING",
"description": "STRING",
"sensors": [{
"tagCode": "STRING",
"type": "STRING",
"typeString": "STRING",
"description": "STRING",
"unit": "STRING"
}],
"asset": "OBJECT_ID"
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets an array of the client's users.
Adds a new user to the client.
get /clients/{client_id}/users
Gets an array of the client's users.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
HTTP status code 200
Returns an array of the client's users.
Body
Media type: application/json
Type: object
Example:
[
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"role": "STRING",
"active": "BOOLEAN"
}
]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
post /clients/{client_id}/users
Adds a new user to the client.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- client_id: required (string)
The clients's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"role": "STRING",
"active": "BOOLEAN"
}
HTTP status code 200
User added.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"role": "STRING",
"active": "BOOLEAN"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
DEVICES
Lets you manipulate your devices.
Allows you to get a list of all of your devices.
get /devices
Allows you to get a list of all of your devices.
A JSON Web Token & Client ID must be sent in the request header.
HTTP status code 200
Returns an array of all of devices you have access to.
Body
Media type: application/json
Type: object
Example:
[
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"serialNumber": "STRING",
"type": "STRING",
"description": "STRING",
"sensors": [{
"tagCode": "STRING",
"type": "STRING",
"typeString": "STRING",
"description": "STRING",
"unit": "STRING"
}],
"asset": "OBJECT_ID",
"location": "OBJECT_ID"
}
]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to work with an individual device.
Returns a single device.
Allows you to edit an existing device.
get /devices/{device_id}
Returns a single device.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- device_id: required (string)
The device's object ID
HTTP status code 200
Returns a device.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"serialNumber": "STRING",
"type": "STRING",
"description": "STRING",
"sensors": [{
"tagCode": "STRING",
"type": "STRING",
"typeString": "STRING",
"description": "STRING",
"unit": "STRING"
}],
"asset": "OBJECT_ID",
"location": "OBJECT_ID"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
put /devices/{device_id}
Allows you to edit an existing device.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- device_id: required (string)
The device's object ID
Body
Media type: application/json
Type: object
Example:
{
"type": "STRING",
"description": "STRING"
}
HTTP status code 200
Device saved.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"serialNumber": "STRING",
"type": "STRING",
"description": "STRING"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to onboard a device to a client.
post /devices/{device_id}/onboard/{client_id}
Allows you to onboard a device to a client.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- device_id: required (string)
The device's object ID
- client_id: required (string)
The client's ObjectId.
HTTP status code 200
Deviced onboarded to client.
Body
Media type: application/json
Type: object
Example:
{
"message": "Device onboarded."
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to get the sensors available on the device.
get /devices/{device_id}/sensors
Allows you to get the sensors available on the device.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- device_id: required (string)
The device's object ID
HTTP status code 200
Returns the sensors available on the device.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"type": "NUMBER",
"typeString": "STRING",
"tagCode": "STRING",
"description": "STRING",
"unit": "STRING"
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Allows you to get details on a single sensor on the device.
get /devices/{device_id}/sensors/{sensor_id}
Allows you to get details on a single sensor on the device.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- device_id: required (string)
The device's object ID
- sensor_id: required (string)
The sensor's object ID
HTTP status code 200
Returns the details of a single sensor.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"type": "NUMBER",
"typeString": "STRING",
"tagCode": "STRING",
"description": "STRING",
"unit": "STRING"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
EVENTS
Gets a single event.
get /events/{event_id}
Gets a single event.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- event_id: required (string)
HTTP status code 200
Returns the event.
Body
Media type: application/json
Type: object
Example:
[{
"_id": "OBJECT_ID",
"type": "STRING",
"tag": "STRING",
"description": "STRING",
"start": "DATE",
"end": "END",
"count": "NUMBER",
"device": {
"serialNumber": "STRING",
"type": "STRING",
"description": "STRING"
},
"asset": {
"tagCode": "STRING",
"name": "STRING",
"description": "STRING",
"location": {
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"]
}
},
"sensor": {
"type": "NUMBER",
"typeString": "STRING",
"description": "STRING",
"unit": "STRING"
}
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets the event data.
get /events/{event_id}/telemetries
Gets the event data.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- event_id: required (string)
Query Parameters
- asset: (string)
A flag to include asset data.
Example:
asset=1
- device: (string)
A flag to include device data.
Example:
device=1
- sensor: (string)
A flag to include sensor data.
Example:
sensor=1
HTTP status code 200
Returns the event data.
Body
Media type: application/json
Type: object
Example:
[{
"timestamp": "DATE MICROSECONDS",
"tag": "STRING",
"data": "NUMBER",
"device": {
"serialNumber": "STRING",
"type": "STRING",
"description": "STRING"
},
"asset": {
"tagCode": "STRING",
"name": "STRING",
"description": "STRING",
"location": {
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"]
}
},
"sensor": {
"type": "NUMBER",
"typeString": "STRING",
"description": "STRING",
"unit": "STRING"
}
}]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
LOCATIONS
Lets you view and edit a location.
Gets a single location.
Updates a location.
get /locations/{location_id}
Gets a single location.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- location_id: required (string)
The location's ObjectId.
HTTP status code 200
A single location.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"],
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
}
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
put /locations/{location_id}
Updates a location.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- location_id: required (string)
The location's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"],
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
}
}
HTTP status code 200
Location updated.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"tagCode": "STRING",
"description": "STRING",
"geolocation": ["NUMBER", "NUMBER"],
"address": {
"street": "STRING",
"street2": "STRING",
"city": "STRING",
"province": "STRING",
"postalCode": "STRING",
"country": "STRING"
}
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
USERS
Lets you manipulate users.
Gets an array of users.
get /users
Gets an array of users.
A JSON Web Token & Client ID must be sent in the request header.
HTTP status code 200
Returns as array of users.
Body
Media type: application/json
Type: object
Example:
[
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"role": "STRING",
"active": "BOOLEAN"
}
]
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Gets a single user.
Edits a user (can't change password).
get /users/{user_id}
Gets a single user.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- user_id: required (string)
The users's ObjectId.
HTTP status code 200
Returns a single user.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"role": "STRING",
"active": "BOOLEAN"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
put /users/{user_id}
Edits a user (can't change password).
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- user_id: required (string)
The users's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"role": "STRING",
"active": "BOOLEAN"
}
HTTP status code 200
User updated.
Body
Media type: application/json
Type: object
Example:
{
"_id": "OBJECT_ID",
"created": "DATE",
"updated": "DATE",
"firstName": "STRING",
"lastName": "STRING",
"email": "STRING",
"role": "STRING",
"active": "BOOLEAN"
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}
Changes a user's password.
put /users/{user_id}/password
Changes a user's password.
A JSON Web Token & Client ID must be sent in the request header.
URI Parameters
- user_id: required (string)
The users's ObjectId.
Body
Media type: application/json
Type: object
Example:
{
"newPassword": "STRING"
}
HTTP status code 200
Password changed.
Body
Media type: application/json
Type: object
Example:
{
"message": "The password has been changed."
}
Secured by JWT
Headers
- x-access-token: required (string)
A JWT access token. Get the JWT using /authenticate
- x-client-id: required (string)
Your unique client ID.
HTTP status code 417
Body
Media type: application/json
Type: object
Example:
{
"code": "417",
"message": "invalid api key"
}