PLEASE READ: if you are looking for the API to manage the Dragonfly Java App then you need to look at this page.

Accuware Dragonfly exposes a RESTful web API that can be used to access and manipulate the state of set of resources registered with a site. The list of resources and the supported methods is summarized in the following table along with examples of usages with cURL.

  • An introduction to the Dragonfly API and an explanation about all the available resources can be found in this page.
ResourceURIAvailable HTTPS Methods
Siteshttps://its.accuware.com/api/v1/sites/GET
Siteshttps://its.accuware.com/api/v1/sites/{siteId}/GET
Levelshttps://its.accuware.com/api/v1/sites/{siteId}/levels/GET
Levelshttps://its.accuware.com/api/v1/sites/{siteId}/levels/{levelId}/GET, PUT, DELETE
Floor planshttps://its.accuware.com/api/v1/sites/{siteId}/floorplans/GET, POST
Floor planshttps://its.accuware.com/api/v1/sites/{siteId}/floorplans/{fpId}/GET
Deviceshttps://cvnav.accuware.com/api/v1/sites/{siteID}/dragonfly/devices/GET, DELETE
User Accountshttps://its.accuware.com/api/v1/sites/{siteId}/accounts/GET

/api/v1/sites/

GET

Retrieves the list of sites registered with an user account

Available response representations:

  • 200 OK – application/json.
  • JSON array of site descriptors.

Example:

Query the list of sites registered with the account “username”:

The result is an array [{…}, {…}, …] of JSON objects:

JSON fields:

  • desc: expiration day of your site along with the type of account.
  • siteId: site identification.
  • address: used to point to the map on the area of interest in to the Accuware dashboard.
  • name: site name.
  • access: access levels for each account registered

/api/v1/sites/{siteId}/

GET

Retrieves information about a specific site

HTTP Request Path Parameter:

  • {siteId}: site identification string.

Available response representations:

  • 200 OK – application/json.
  • JSON representation of the site.

Example:

Retrieve information about the site with siteId=”1001″:

The result is a JSON object:

JSON fields:

  • desc: expiration day of your site along with the type of account.
  • siteId: site identification.
  • address: used to point to the map on the area of interest in to the Accuware dashboard.
  • name: site name.
  • access: access levels for each account registered

/api/v1/sites/{siteId}/levels/

GET

Returns all the levels for the current site

HTTP Request Path Parameter:

  • {siteId}: site identification string.

Available response representations:

  • 200 OK – application/json
  • JSON array of levels associated to a site.

Example:

Returns a JSON representation of all the levels for site with siteId=”1001″:

The result is an array [{…}, {…}, …] of JSON objects:

/api/v1/sites/{siteId}/levels/{levelId}/

GET

Returns a specific level for the current site

HTTP Request Path Parameter:

  • {siteId}: site identification string.
  • {levelId}: level identification string.

Available response representations:

  • 200 OK – application/json.
  • JSON representation of a level.

Example:

Returns a JSON representation of the level “1” for site with siteId=”1001″:

The result is an array [{…}, {…}, …] of JSON objects:

PUT

Create a new level for the site.

HTTP Request Path Parameter:

  • {siteId}: site identification string
  • {levelId}: level identification string.

Accepted representations:

  • application/x-www-form-urlencoded

Level information:

  • The fields name, desc and alt can contain empty values

Example:

Create level with LevelID 11 in siteId 1001″:

The result is a JSON that describes the level just registered:

DELETE

Remove a level from the selected site

HTTP Request Path Parameter:

  • {siteId}: site identification string.
  • {levelId}: level identification string.

Accepted representations:

  • none
  • No information is passed along with the request.

Example:

Remove the level with levelID 11 from siteId 1001:

The result is a confirmation message:

/api/v1/sites/{siteId}/floorplans/

GET

Returns all the floor plans for the current site

HTTP Request Path Parameter:

  • {siteId}: site identification string.

Available response representations:

  • 200 OK – application/json
  • JSON array of floor plans

Example:

Returns a JSON representation of all the levels for site with siteId=”1001″:

The result is an array [{…}, {…}, …] of JSON objects:

JSON fields:

  • desc:floor plan’s description.
  • levelID: level associated to the floor plan.
  • kmlAligned: link to the transformed KML file.
  • name: floor plan’s name.
  • kml: link to the original KML file.
  • access: private (not relevant).
  • fpID: floor plan identification string.

POST

Upload a floor plan in the current site.

HTTP Request Path Parameter:

  • {siteId}: site identification string

Accepted representations:

  • form-data

Example:

Upload the floor plan of the Fourth Floor on the level 4 in the site with siteId=”1001″:

At the end of the upload process, you should display:

/api/v1/sites/{siteId}/floorplans/{fpId}/

GET

Returns a specific floor plan for the current site

HTTP Request Path Parameter:

  • {siteId}: site identification string.
  • {fpId}: floor plan identification string.

Available response representations:

  • 200 OK – application/json
  • JSON representation of a floor plan

Example:

Returns a JSON representation of the floor plan “aaa1111″ for site with siteId=”1001”:

The result is an array [{…}, {…}, …] of JSON objects:

JSON fields:

  • desc: floor plan’s description.
  • levelID: level associated to the floor plan.
  • kmlAligned: link to the transformed KML file.
  • name: floor plan’s name.
  • kml: link to the original KML file.
  • access: private (not relevant).
  • fpID: floor plan identification string.

/api/v1/sites/{siteID}/dragonfly/devices/

GET

Retrieves several information about all the devices that are running

HTTP Request Header:

  • Content-Type: application/json

HTTP Request Path Parameter:

  • {siteId}: site identification string.

Available response representations:

  • 200: Array of Device List Object
  • 400: Error Object
  • 401: “Not authenticated”

Example:

Retrieve the user defined objects and the status objects of all the devices registered within site 1001:

The result is a JSON like this one:

JSON fields:

  • mac: the device unique ID generated by the Dragonfly server. The pseudo MAC address contains a total of 12 characters beginning with a “D”.
  • device status:
    • battery: estimated battery percentage. Value with minus (-) means that the battery is charging.
    • fw_version: firmware version.
    • received_at: timestamp of the last status.
    • type_of_device: Dragonfly
  • position:
    • siteID: site identification.
    • levelID: last level identification
    • source: Dragonfly.
    • device: the device unique ID generated by the server. The pseudo MAC address contains a total of 12 characters beginning with a “D”.
    • fixed_at: last location fix.
    • lat/lng: a pair of latitude/longitude coordinates.
    • alt: the altitude in meters.
    • precision: an estimated radius of confidence where the device can be found.
  • device_type: “D”
  • udo:
    • name: the optional name automatically assigned by the Dragonfly App or assigned manually using the Edit button under the Action column.
    • desc: the optional description automatically assigned by the Dragonfly App or assigned manually using the Edit button under the Action column.
  • current_server_time: server timestamp when the query was made.

Timestamps: the timestamps are UTC Unix epoch timestamps in milliseconds. The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). You can find an Epoch & Unix Timestamp Conversion Tool at this link.

DELETE

Remove ALL the devices associated with a specific site (this is not reversible)

HTTP Request Path Parameter:

  • {siteId}: site identification string

Accepted representations:

  • none
  • No information is passed along with the request

Example:

Remove all the devices associates with siteId 1001:

The result is a confirmation message:

/api/v1/sites/{siteId}/accounts/

GET

Retrieves all the user accounts associated to a site

HTTP Request Path Parameter:

  • {siteId}: site identification string.

Available response representations:

  • 200 OK – application/json.
  • JSON representation of user accounts associated to a site.

Example:

Retrieves a JSON representation of all the user accounts associated with siteId=”1001″:

The result is a JSON Object:

JSON fields:

  • username: username associated with the site.
  • access: access levels for the username registered.