Device Management

Groups

Device or asset groups in Carriots

Create

Create group

URL: http://api.carriots.com/groups/
HTTP method: POST

Attributes:

Attribute Description
name (mandatory) Text. 50 characters max.
Unique.
Group name.
Example: g001
id_service (mandatory) Text.
Service identifier
Example: s0001@carriots
description (optional) Text. 200 characters max.
Group description.
Example: First floor parking sensor.
enabled (mandatory) Boolean. Valid values: 0, 1, true or false.
Group enabled, default true
Example: true

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2001 message: group persisted details:
400 Request not valid
Possible values:
- code: 4001 message: Json bad formed details:
- code: 4003 message: validation error details: {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

POST http://api.carriots.com/groups/

Response example:

Show

Show group

URL: http://api.carriots.com/groups/-- ID_developer --/
HTTP method: GET
Response: json/xml

Response codes

Code Description
200 Operation successfull
Possible values:
- Group JSON object
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/groups/Antenas@carriots/

Response example:

List

Group list, max. 1000

URL: http://api.carriots.com/groups/
HTTP method: GET
Response: json/xml

Parameters:

Attribute Description
name (optional) Text. 50 characters max.
Filter list result by field name.
Example: g0001
id_developer (optional) Text. 50 characters max.
Filter list result by field id_developer.
Example: g0001@carriots
enabled (optional) Boolean. Valid values: 0, 1, true or false.
Filter list result by field enabled.
Example: true
owner (optional) username.
Filter list result by field owner.
Example: jlopez
updater (optional) username.
Filter list result by field updater.
Example: jlopez
created_at (optional) Timestamp.
Filter list result by field created_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: created_at=1337009328
max (optional) Integer. Values between 1 and 1000.
Defines the number of results to be returned. Max and default value is 1000.
Example: 250
sort (optional) Field name.
Sort the result by the given field. Default value is name.
Example: creation_date
order (optional) Integer. Valid values: -1 or 1
Result order criteria: -1 for descending and 1 for ascending.
Example: -1
offset (optional) Integer.
Result offset. List will begin at the given offset.
Example: 100

Response codes

Code Description
200 Operation successfull
Possible values:
- total_documents:result numbers result: Group JSON objects set
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/groups/

Response example:

Update

Group update

URL: http://api.carriots.com/groups/-- ID_developer --/
HTTP method: PUT

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2005 message: group updated details:Group JSON object
400 Request not valid
Possible values:
- code: 4001 message: nonexistent file details:
- code: 4003 message: validation error details:{field: error message,...}
- code: 4004 message: format parameter invalid details:{field: error message,...}
- code: 4005 message: concurrency error details:{field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

PUT http://api.carriots.com/groups/defaultGroup@carriots/

Response example:

Delete

Group delete

URL: http://api.carriots.com/groups/-- ID_developer --/
HTTP method: DELETE

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2004 message: group deleted details:
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

DELETE http://api.carriots.com/groups/Antenas@carriots/

Response example:

Show Asset

Show asset from a group

URL: http://api.carriots.com/groups/-- Group ID_developer --/assets/-- Asset ID_developer --/
HTTP method: GET
Response: json/xml

Request example:

GET http://api.carriots.com/groups/defaultGroup@carriots/assets/Assintiendo@carriots/

Response example:

Asset List

Asset list from a group, max. 1000

URL: http://api.carriots.com/groups/-- ID_developer --/assets/
HTTP method: GET
Response: json/xml

Request example:

GET http://api.carriots.com/groups/Grupo@carriots/assets/

Response example:

Show Device

Device show from a group

URL: http://api.carriots.com/groups/-- Group ID_developer --/devices/-- Device ID_developer --/
HTTP method: GET
Response: json/xml
Show List

Device list from a group, max. 1000

URL: http://api.carriots.com/groups/-- ID_developer --/devices/
HTTP method: GET
Response: json/xml

Request example:

GET api.carriots.com/groups/Grupo@carriots/devices/

Response example:

Assets

Carriots assets

Create

Create Asset

URL: http://api.carriots.com/assets/
HTTP method: POST

Attributes:

Attribute Description
name (mandatory) Text. 50 characters max.
Unique.
Asset name.
Example: a001
id_developer (automatic) Text.
Composed by name + "@" + name_customer
Example: a001@carriots
id_group (mandatory) Text.
Group identifier
description (optional) Text. 200 characters max.
Asset description.
Example: Container asset.
enabled (mandatory) Boolean. Valid values: 0, 1, true or false.
Asset enabled, default true
Example: true

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2001 message: asset persisted details:
400 Request not valid
Possible values:
- code: 4001 message: Json bad formed details:
- code: 4003 message: validation error details: {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

POST http://api.carriots.com/assets/

Response example:

Show

Show asset

URL: http://api.carriots.com/assets/-- ID_developer --/
HTTP method: GET
Response: json/xml

Response codes

Code Description
200 Operation successfull
Possible values:
- Group JSON object
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/assets/asset_name@carriots/

Response example:

List

Asset list, max. 1000

URL: http://api.carriots.com/assets/
HTTP method: GET
Response: json/xml

Parameters:

Attribute Description
name (optional) Text. 50 characters max.
Filter list result by field name.
Example: a001
id_developer (optional) Text. 50 characters max.
Filter list result by field id_developer.
Example: a001@carriots
enabled (optional) Boolean. Valid values: 0, 1, true or false.
Filter list result by field enabled.
Example: true
owner (optional) username.
Filter list result by field owner.
Example: jlopez
updater (optional) username.
Filter list result by field updater.
Example: jlopez
created_at (optional) Timestamp.
Filter list result by field created_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: created_at=1337009328
max (optional) Integer. Values between 1 and 1000.
Defines the number of results to be returned. Max and default value is 1000.
Example: 250
sort (optional) Field name.
Sort the result by the given field. Default value is name.
Example: creation_date
order (optional) Integer. Valid values: -1 or 1
Result order criteria: -1 for descending and 1 for ascending.
Example: -1
offset (optional) Integer.
Result offset. List will begin at the given offset.
Example: 100

Response codes

Code Description
200 Operation successfull
Possible values:
- total_documents:result numbers result: Asset JSON objects set
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/assets/

Response example:

Update

Asset update

URL: http://api.carriots.com/assets/-- ID_developer --/
HTTP method: PUT

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2005 message: asset updated details:Asset JSON object
400 Request not valid
Possible values:
- code: 4001 message: nonexistent file details:
- code: 4003 message: validation error details:{field: error message,...}
- code: 4004 message: format parameter invalid details:{field: error message,...}
- code: 4005 message: concurrency error details:{field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

PUT http://api.carriots.com/assets/asset_name@carriots/

Response example:

Delete

Asset delete

URL: http://api.carriots.com/assets/-- ID_developer --/
HTTP method: DELETE

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2004 message: asset deleted details:
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

DELETE http://api.carriots.com/assets/asset_name@carriots/

Response example:

Show Device

Device show from an asset

URL: http://api.carriots.com/assets/-- Asset ID_developer --/devices/-- Device ID_developer --/
HTTP method: GET
Response: json/xml

Request example:

GET http://api.carriots.com/assets/Assintiendo@carriots/devices/TestDevice@carriots/

Response example:

Device List

Device list from an asset, max. 1000

URL: http://api.carriots.com/assets/-- ID_developer --/devices/
HTTP method: GET
Response: json/xml

Request example:

GET http://api.carriots.com/assets/Assintiendo@carriots/devices/

Response example:

Devices

Device management in Carriots.

Create

Device management in Carriots.

URL: http://api.carriots.com/devices/
HTTP method: POST

Attributes:

Attribute Description
type (mandatory) Text (50 chars max).
Can be one of the device types available in Carriots. Can be listed in:
http://api.carriots.com/types/
Users can use any custom device type.
Example 1: GPS tracker
name (mandatory) Text. 50 characters max.
Device name.
Example: d0001
id_group (mandatory) Text.
Group identifier.
You must specify id_group or id_asset. They are exclusive.
Example: g0001@carriots
id_asset (mandatory) Text.
Asset identifier.
You must specify id_group or id_asset. They are exclusive.
Example: a0001@carriots
description (optional) Device description.
sensor (optional) Text (50 chars max.).
Can be one of the sensor types available in Carriots. Can be listed in:
http://api.carriots.com/sensors/
Users can use any custom sensor type.
Example 1: thermometer
checksum (optional) Text HMAC or SHA1. 40 chars.
Code used for stream sanity check.
Example: 8e0f1692c01e3333d0cdefe6840c5d61ffb7e3a6
time_zone (optional) Time zone.
Defines device time zone. Default value is “Europe/Madrid”.
Value must be one defined by Carriots:
http://api.carriots.com/time_zones/
Example TZ: Europe/Paris
frequency_status (optional) Positive integer. Defines a number of minutes. Default value 1440.
Defines the time lapse in which a status stream must have been received.
Example (24h): 1440
frequency_stream (optional) Positive integer. Defines a number of minutes. Default value 1440.
Defines the time lapse in which a data stream must have been received.
Example (24h): 1440
lon (optional) Number. Defines the longitude coordinate.
Carriots uses the GeoJSON Format Specification to store a device's position. To specify the coordinates, you must use the WGS84 datum and units of longitude and latitude decimal degrees.
Example: -3.703
lat (optional) Number. Defines the latitude coordinate.
Carriots uses the GeoJSON Format Specification to store a device's position. To specify the coordinates, you must use the WGS84 datum and units of longitude and latitude decimal degrees.
Example: 40.417
enabled (mandatory) Boolean. Valid values: 0, 1, true or false.
Enables or disables the device. Default is true (enabled).
Example: true
networking (optional) Json.
Detailed device connexion information.
JSON must be composed by:
“type”: Values admitted: “ethernet”, “gprs”, “wifi”, “zigbee”
“conn_address”: Text. 50 characters max.
Only for types “ethernet”, “wifi” or “zigbee”. Defines an IP address orMAC address
“sim_card”: Text. 18 chars.
Only for type “gprs”. Holds the SIM card number “telephone_number”: Text. 15 characters max.
Only for type “gprs”. Telephone number
“carrier”: Text. 50 characters max.
Only for type “gprs”. Carrier name
Example 1:
Example 2:

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2001 message: device persisted details:
400 Request not valid
Possible values:
- code: 4001 message: Json bad formed details:
- code: 4003 message: validation error details: {field: error message, ...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

POST http://api.carriots.com/devices/

Response example:

Show

Shows device information.

URL: http://api.carriots.com/devices/-- ID_developer --/
HTTP method: GET
Response: json/xml

Response codes

Code Description
200 Operation successfull
Possible values:
- JSON Device Object
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid details:{field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/devices/t0001@carriots/

Response example:

List

List of devices, max 1000

URL: http://api.carriots.com/devices/
HTTP method: GET
Response: json/xml

Parameters:

Attribute Description
_t (optional) Text: "str" or "sta".
Filter list result by data streams (using "str") or status streams (using "sta"). If ommited, all streams (data and status) are listed.
Example: "str" list only data streams.
type (optional) Identifier.
Filter list result by field type.
Example: GPStracker
name (optional) Text. 50 characters max.
Filter list result by field name.
Example: d001
id_developer (optional) Text.
Filter list result by field id_developer.
Example: d0001@carriots
status (optional) Text. Valid values: “ok”, “no_data”, “no_status”, “disconnected”
Filter list result by device status
description (optional) Text. 200 characters.
Filter list result by field description.
sensor (optional) Identifier.
Filter list result by field sensor.
Example: thermometer
firmware (optional) Text. 50 characters max.
Filter list result by field firmware.
Example: db01.v2.7.4.0.0.3_BDLKD
geo_lon
geo_lat
geo_distance

(optional)
Numbers.
Filter the devices that are inside the circle defined by the parameters.
geo_lon and geo_lat specify the circle center.
geo_distance specifies the radius in meters.
Example: geo_lon=-3.703&geo_lat=40.416&geo_distance=1000
enabled (optional) Boolean. Valid values: 0, 1, true or false.
Filter list result by field enabled.
Example: true
created_at (optional) Timestamp.
Filter list result by field created_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: created_at=1337009328
updated_at (optional) Timestamp.
Filter list result by field updated_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: updated_at_to=1337009328
owner (optional) username.
Filter list result by field owner.
Example: jlopez
updater (optional) username.
Filter list result by field updater.
Example: jlopez
conn_address (optional) Text.
Filter list result by field conn_address.
Example: 193.110.195.34
conn_type (optional) Connexion type. Must be one of “ethernet”, “gprs”, “wifi”, “zigbee”
Filter list result by field conn_type.
Example: ethernet
sim_card (optional) Text. 18 characters
Filter list result by field sim_card.
Example: 546788473851239747
telephone_number (optional) Text.15 characters
Filter list result by field tel_number.
Example: 620145282
carrier (optional) Text. 50 characters max.
Filter list result by field carrier.
Example: vodafone
max (optional) Integer. Values between 1 and 1000. Defines the number of results to be returned. Max and default value is 1000. Example: 250
sort (optional) Field name.
Sort the result by the given field. Default value is device.
Example: creation_date
order (optional) Integer. Valid values: -1 or 1
Result order criteria: -1 for descending and 1 for ascending.
Example: -1
offset (optional) Integer.
Result offset. List will begin at the given offset.
Example: 100

Response codes

Code Description
200 Operation successfull
Possible values:
- total_documents:result numbers result: JSON device object set
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid details:{field: error message,...}
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/devices/

Response example:

Update

Update a device

URL: http://api.carriots.com/devices/-- ID_developer --/
HTTP method: PUT

Response codes

Code Description
200 Operation successfull
Possible values:
- code:2005 messsage: device updated details: JSON Device object
400 Request not valid
Possible values:
- code: 4001 message: nonexistent file details:
- code: 4003 message: validation error details:{field: error message,...}
- code: 4004 message: format parameter invalid details:{field: error message,...}
- code: 4005 message: concurrenciy error details:{version:}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

PUT http://api.carriots.com/devices/newdevice@carriots/

Response example:

Delete

Delete device.

URL: http://api.carriots.com/devices/-- ID_developer --/
HTTP method: DELETE
Response: json/xml

Response codes

Code Description
200 Operation successfull
Possible values:
- code_ 2004 message: Device deleted
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid details:{field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

DELETE http://api.carriots.com/devices/t0001@carriots/

Response example:

Device config create (file)

Create device config file

URL: http://api.carriots.com/devices/-- Device ID_developer --/deviceconfigs/
HTTP method: POST
Response: json/xml

Attributes:

Attribute Description
name (mandatory) Text. 50 characters max.
File name.
Example: firmware
version (mandatory) Text.
File version.
Example: 1.0
file (mandatory) Text.
File content base64 encoded
Example: InZlcnNpb24iOiI0Njg0ZTgwYy0yZTE3LTQ0YWUtOGM0OS1lN2NiZjczYWNiY2Ei
date_deployed (optional) Timestamp.
File date deployed.
Example: 1337009328

Response codes

Code Description
201 Created
Possible values:
- code:2001, message:Device_config created, details:JSON Device object
400 Bad Request
Possible values:
- code: 4003 message: Validation error {field: error message,...}
401 Unauthorized
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

POST http://api.carriots.com/devices/defaultDevice@carriots/deviceconfigs/

Response example:

Device configs list (files)

List of devices configuration files, max 1000

URL: http://api.carriots.com/devices/-- ID_developer --/deviceconfigs/
HTTP method: GET
Response: json/xml

Parameters:

Attribute Description
name (optional) Text. 50 characters max.
Filter list result by field name.
Example: firmware
version (optional) Text.
Filter list result by field version.
Example: 1.0
date_deployed (optional) Timestamp.
Filter list result by field date_deployed.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: date_deployed_from=1337009328
created_at (optional) Timestamp.
Filter list result by field created_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: created_at_from=1337009328
updated_at (optional) Timestamp.
Filter list result by field updated_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: updated_at_to=1337009328
owner (optional) username.
Filter list result by field owner.
Example: jlopez
updater (optional) username.
Filter list result by field updater.
Example: jlopez
sort (optional) Field name.
Sort the result by the given field.
Example: creation_date
order (optional) Integer. Valid values: -1 or 1
Result order criteria: -1 for descending and 1 for ascending. Default is ascending
Example: -1
offset (optional) Integer.
Result offset. List will begin at the given offset.
Example: 100

Response codes

Code Description
200 Operation successfull
Possible values:
- total_documents:result numbers result: JSON device configs object set
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid details:{field: error message,...}
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/devices/test@carriots/deviceconfigs/

Response example:

Device config download (file)

Download device config file content

URL: http://api.carriots.com/devices/-- Device ID_developer --/deviceconfigs/-- File name --/-- File version --/
HTTP method: GET
Response: json/xml

Note: If file version is not specified, the latest version will be downloaded (order by "created_at" field)

Response codes

Code Description
200 Operation successfull
Possible values:
- Device config file content
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example 1:

GET http://api.carriots.com/devices/defaultDevice@carriots/deviceconfigs/firmware/1.0/

Response example 1:

Request example 2:

GET http://api.carriots.com/devices/defaultDevice@carriots/deviceconfigs/firmware/

Response example 2:

The latest file config version will be download.

List Streams

Stream list with 1000 max elements for specified device. As a status stream is treated as a normal data stream, management URLs are the same, except for the filter parameter.

URL: http://api.carriots.com/devices/-- Device ID_developer --/streams/
HTTP method: GET
Response: json/xml

Parameters:

Attribute Description
_m (optional) Integer. Valid values: 1
Returns metadatas about the request.
Example: _m=1
protocol (optional) Text. 50 characters max.
Filter list result by field protocol.
Example: v1
at (optional) Timestamp. 50 characters max.
Filter list result by field at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: at_to=1337009328
owner (optional) username.
Filter list result by field owner.
Example: jlopez
updater (optional) username.
Filter list result by field updater.
Example: jlopez
created_at (optional) Timestamp.
Filter list result by field created_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: created_at=1337009328
max (optional) Integer. Values between 1 and 1000.
Defines the number of results to be returned. Max and default value is 1000.
Example: 250
sort (optional) Field name.
Sort the result by the given field. Default value is device.
Example: creation_date
order (optional) Integer. Valid values: -1 or 1
Result order criteria: -1 for descending and 1 for ascending.
Example: -1
offset (optional) Integer.
Result offset. List will begin at the given offset.
Example: 100

Response codes

Code Description
200 Operation successfull
Possible values:
- total_documents: result numbers result: Set of JSON status objects
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid details:{field: error message, …..}
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }
Delete Streams

Removes the device streams permanently.

URL: http://api.carriots.com/devices/-- Device ID_developer/streams/
HTTP method: DELETE

Parameters:

Attribute Description
_t (optional) Text: "str" or "sta".
Filter list result by data streams (using "str") or status streams (using "sta"). If ommited, all streams (data and status) are listed.
Example: "str" list only data streams.
protocol (optional) Text. 50 characters max.
Filter list result by field protocol.
Example: v1
at (optional) Timestamp. 50 characters max.
Filter list result by field at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: at_to=1337009328
owner (optional) username.
Filter list result by field owner.
Example: jlopez
updater (optional) username.
Filter list result by field updater.
Example: jlopez
created_at (optional) Timestamp.
Filter list result by field created_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: created_at=1337009328
max (optional) Integer. Values between 1 and 1000.
Defines the number of results to be returned. Max and default value is 1000.
Example: 250
sort (optional) Field name.
Sort the result by the given field. Default value is device.
Example: creation_date
order (optional) Integer. Valid values: -1 or 1
Result order criteria: -1 for descending and 1 for ascending.
Example: -1
offset (optional) Integer.
Result offset. List will begin at the given offset.
Example: 100

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2004 message: stream deleted details:
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Models

Carriots device model management.

Create

Create Model

URL: http://api.carriots.com/models/
HTTP method: POST

Attributes:

Attribute Description
name (mandatory) Text. 50 characters max.
Unique.
Model name.
Example: m001
description (optional) Text. 200 characters max.
Model description.
Example: Temperature sensor
properties (optional) Json
Model properties to be propagated to a device.
enabled (mandatory) Boolean. Valid values: 0, 1, true or false.
Model enabled, default true
Example: true

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2001 message: model persisted details:
400 Request not valid
Possible values:
- code: 4001 message: Json bad formed details:
- code: 4003 message: validation error details: {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

POST http://api.carriots.com/models/

Response example:

Show

Model show

URL: http://api.carriots.com/models/-- ID_developer --/
HTTP method: GET
Response: json/xml

Response codes

Code Description
200 Operation successfull
Possible values:
- JSon/xml
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/models/TestModel2@carriots/

Response example:

List

Model list, max. 1000

URL: http://api.carriots.com/models/
HTTP method: GET
Response: json/xml

Parameters:

Attribute Description
name (optional) Text. 50 characters max.
Filter list result by field name.
Example: m001
enabled (optional) Boolean. Valid values: 0, 1, true or false.
Filter list result by field enabled.
Example: true
owner (optional) username.
Filter list result by field owner.
Example: jlopez
updater (optional) username.
Filter list result by field updater.
Example: jlopez
created_at (optional) Timestamp.
Filter list result by field created_at.
Example: 1337009328
to and from modificators allows to specify a range. Extreme values are included.
Example: created_at=1337009328
max (optional) Integer. Values between 1 and 1000.
Defines the number of results to be returned. Max and default value is 1000.
Example: 250
sort (optional) Field name.
Sort the result by the given field. Default value is name.
Example: creation_date
order (optional) Integer. Valid values: -1 or 1
Result order criteria: -1 for descending and 1 for ascending.
Example: -1
offset (optional) Integer.
Result offset. List will begin at the given offset.
Example: 100

Response codes

Code Description
200 Operation successfull
Possible values:
- total_documents:result numbers result: Model JSON objects set
400 Request not valid
Possible values:
- code: 4004 message: format parameter invalid {field: error message,...}
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

GET http://api.carriots.com/models/

Response example:

Update

Model update

URL: http://api.carriots.com/models/-- ID_developer --/
HTTP method: PUT

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2005 message: model updated details:Model JSON object
400 Request not valid
Possible values:
- code: 4001 message: nonexistent file details:
- code: 4003 message: validation error details:{field: error message,...}
- code: 4004 message: format parameter invalid details:{field: error message,...}
- code: 4005 message: concurrency error details:{version: }
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

PUT http://api.carriots.com/models/TestModel2@carriots/

Response example:

Delete

Model delete

URL: http://api.carriots.com/models/-- ID_developer --/
HTTP method: DELETE

Response codes

Code Description
200 Operation successfull
Possible values:
- code: 2004 message: model deleted details:
404 Resource not found
503 Service unavailable.
- code: 5031 message: BD error details:
- code: 5032 message: exception details: {message: }

Request example:

DELETE http://api.carriots.com/models/TestModel2@carriots/

Response example: