The Dragonfly Cloud server resources API mentioned inside this page has nothing to do with the Dragonfly App API used to manage the resources of the Dragonfly App! If your are looking for the API to manage the Dragonfly App please look at this page.
The Dragonfly Cloud server exposes a RESTful web API that can be used to access and manipulate the state of the resources registered with a site.
Available resources
Sites
Resources are accessed in the context of a particular site. Sites are identified by short alphanumeric strings (the SiteId) assigned by Onit during the creation of each site. The SiteID can be found inside the Onit Activation email and inside the Dragonfly dashboard under General > Site.
Levels
Each site can be made of one or multiple levels identified by a numeric IDs (the LevelId) that can be a positive or negative integer. By default, each site contains a default level (LevelId = 0) that can’t be eliminated. Using the Dragonfly dashboard it is possible to create up to 30 Levels (from Level -10 to level +20) plus Level 0. Additional levels can be created using this PUT API call. Levels can be used to divide floor plans based on:
- their vertical positions (e.g. different floors of the same building).
- or their different positions (e.g. different buildings of the same complex or different buildings of different complexes).
Floorplans
Floor plans provide reference points inside a building, such as the position of walls, rooms, hallways, elevators, staircases, atriums, windows, doors etc… Each floorplan is identified by an alphanumeric strings (the fpId) assigned by the Dragonfly Cloud server during the upload of the floor plan image.
Accounts
Access to the resources is restricted to registered users on a per-site basis. Each account is identified by an username (an email address) and a password. Onit provides three possible access levels for each user account registered with a site:
- Read-Only (access = 10)
- Can view everything but can not make changes in most of the things.
- Can NOT view other accounts and can NOT add other accounts.
- Read-Write (access = 20)
- Can NOT view other accounts and can NOT add other accounts.
- Can NOT upload/edit floor plans.
-
Can Edit the Site info.
-
Can Create/Edit/Delete Levels.
-
Can Delete Floor plans.
-
Can Create/Edit/Delete a Geo-fences.
-
Can Edit/Delete a Dragonfly device in the Map view.
-
Can Create/Edit/Delete Visual Markers.
-
Can delete a dragonfly device from the Registered Devices table.
-
Full Control (access = 30)
- Can do everything.
Devices
Each device is an active (or inactive) instance of the Dragonfly App. Each device is identified by a unique ID generated by the Dragonfly App. The deviceId is a pseudo MAC address that contains a total of 12 characters beginning with a “D”.
Geo-fences
Geo-fences are virtual polygons (made of multiple vertexes) used in order to divide a floor plan into multiple areas allowing afterwards to retrieve the sub area in which each one of the devices is located. Each geo-fences is identified by its metadataId.
API performance
The Dragonfly cloud server supports HTTPS data compression allowing thus a better use of available bandwidth between your client and our server and providing in the end greater transmission speeds between both.
In order to make use of the compression you have to include the following supported compression schema in the Header of the HTTPS request:
“Accept-Encoding: gzip, deflate”
More information in this page.
How to access the API
The easiest way to access the API is via the command line tool cURL freely available at https://curl.haxx.se/. cURL is a command line tool for transferring data with URL syntax. To install and use cURL:
- Download cURL at this link.
- Unzip cURL in a folder on your PC (e.g. C:\curl).
- Open a shell/command line and go in the cURL folder (e.g. C:\curl).
Using cURL, it is possible to supply user credentials necessary to access a resource:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/
By default, the HTTP method GET is invoked on the resource. Other methods can be called with the –X option:
curl -u username:password -X PUT https://its.dragonflycv.com/api/v1/
curl -u username:password -X DELETE https://its.dragonflycv.com/api/v1/
Alternative REST clients
If you don’t like command line tools you can find alternative REST clients inside this website.