The Dragonfly Cloud server resources API mentioned inside this page has nothing to do with the Dragonfly App API that are 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. The list of resources and the supported methods is summarized in the following table:
https://its.dragonflycv.com/api/v1/sites/
GET
Retrieves information about all the sites.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8
- Body: JSON array of site descriptors
Example:
Query the list of sites registered with the account:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/
The result is an array [{…}, {…}, …] of JSON objects:
[
{
"desc": "EXP. JUN 8th - DEVELOPMENT",
"siteId": "1001",
"address": "1.899079,4.80904",
"name": "Site A",
"access": "30"
},
{
"desc": "OPEN ENDED - PRODUCTION",
"siteId": "1002",
"address": "43.857165,-79.460979",
"name": "Site B",
"access": "30"
}
]
JSON fields:
- desc: expiration date 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 Dragonfly dashboard.
- name: site name.
- access: access level for of the account that is issuing the request.
https://its.dragonflycv.com/api/v1/sites/{siteId}/
GET
Retrieves information about a specific site.
Path parameters:
- {siteId}: site identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8
- Body: JSON representation of the site.
Example:
Retrieve information about the site with site with ID “1001”:
<code”>curl -u username:password https://its.dragonflycv.com/api/v1/sites/1001/
The result is a JSON object:
{
"desc": "EXP. JUN 8th - DEVELOPMENT",
"siteId": "1001",
"address": "1.899079,4.80904",
"name": "Site A",
"access": "30"
}
JSON fields:
- desc: expiration date 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 Dragonfly dashboard.
- name: site name.
- access: access level for of the account that is issuing the request.
https://its.dragonflycv.com/api/v1/sites/{siteId}/levels/
Retrieves information about all the levels for a specific site.Path parameters:
- {siteId}: site identification string.
Request: no information is passed along with the request.Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8.
- Body: JSON array of levels associated to a site.
Example:Returns a JSON representation of all the levels for site with ID “1001”:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/1001/levels/
The result is an array [{…}, {…}, …] of JSON objects:
[
{
"desc":"",
"levelId":1,
"alt":"NaN",
"name":"First Floor"
},
{
"desc":"",
"levelId":2,
"alt":"NaN",
"name":"Second Floor"
},
{
"desc":"",
"levelId":3,
"alt":"NaN",
"name":"Penthouse"
}
]
JSON fields:
- desc: level’s description.
- levelId: level identification number.
- alt: altitude (not used at present).
- name: level’s name.
https://its.dragonflycv.com/api/v1/sites/{siteId}/levels/{levelId}/
GET
Retrieves information about a specific level of a specific site.
Path parameters:
- {siteId}: site identification string.
- {levelId}: level identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8.
- Body: JSON representation of a level.
Example:
Returns the info related to level “1” for site with Id “1001”:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/1001/levels/1/
The result is an array [{…}, {…}, …] of JSON objects:
{
"desc":"",
"levelId":1,
"alt":"NaN",
"name":"First Floor"
}
JSON fields:
- desc: level’s description.
- levelId: level identification number.
- alt: altitude (not used at present).
- name: level’s name.
PUT
Create a new level (or modify the information of an existing level) for a specific site.
Path parameters:
- {siteId}: site identification string.
- {levelId}: level identification string.
Request:
- Header:
- Content-type:application/x-www-form-urlencoded.
- Body:
- desc: level’s description – NOT MANDATORY.
- name: level’s name – NOT MANDATORY.
Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8
- Body: JSON representation of the level.
Example:
Create level with ID “11” in site with ID “1001”:
curl -u username:password -X PUT -d "name=Level_11&desc=This is a new level" https://its.dragonflycv.com/api/v1/sites/1001/levels/11/
The result is a JSON that describes the level just registered:
{
"desc": "This is a new level",
"levelId": 11,
"alt": "NaN",
"name": "Level_11"
}
JSON fields:
- desc: level’s description.
- levelId: level identification number.
- alt: altitude (not used at present).
- name: level’s name.
DELETE
Remove a specific level from the specific site.
Path parameters:
- {siteId}: site identification string.
- {levelId}: level identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Body: JSON confirmation message.
Example:
Remove the level with levelID 11 from siteId 1001:
curl -u username:password -X DELETE https://its.dragonflycv.com/api/v1/sites/1001/levels/11/
The result is a confirmation message:
{
"status": "success"
}
https://its.dragonflycv.com/api/v1/sites/{siteId}/floorplans/
GET
Returns information about the floor plans for a specific site.
Path parameters:
- {siteId}: site identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8.
- Body: JSON array of floorplans associated to a site.
Example:
Returns a JSON representation of all the floor plans for site with site ID “1001”:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/1001/floorplans/
The result is an array [{…}, {…}, …] of JSON objects:
[
{
"desc":"",
"levelId":0,
"kmlAligned":"https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/1001/aaaa1111_a.kml",
"name":"First Floor",
"kml":"https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/1001/aaaa1111_o.kml",
"access":"private",
"fpId":"aaaa1111"
},
{
"desc":"",
"levelId":1,
"kmlAligned":"https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/1001/aaaa2222_a.kml",
"name":"Second Floor",
"kml":"https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/1001/aaaa2222_o.kml",
"access":"private",
"fpId":"aaaa2222"
}
]
JSON fields:
- desc: floor plan’s description.
- levelID: level associated to the floor plan.
- kmlAligned: link to a KML file that contains:
- the boundaries of a pre-rotated floor plan image.
- the link to the pre-rotated floor plan image.
- name: floor plan’s name.
- kml: link to the original KML file that contains:
- the boundaries of a north aligned floor plan image.
- the rotation to be applied to the floor plan image.
- the link to the original floor plan image.
- access: private (not relevant).
- fpID: floor plan identification string.
POST
Upload a floor plan to a specific site.
Only one floor plan per level is allowed.
Path parameters:
- {siteId}: site identification string
Request:
- Header:
- Content-type:multipart/form-data.
- Body:
- username: your account username.
- password: your account password.
- levelId: level associated to the floor plan – NOT MANDATORY (if not specified then level 0 is used).
- name: site name – NOT MANDATORY.
- desc: site description – NOT MANDATORY.
- image: path to the image file related to the floor plan.
- kml: link to the original KML file that contains:
- the boundaries of a north aligned floor plan image.
- the rotation to be applied to the floor plan image.
- the link to the original floor plan image.
Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8.
- Body: JSON representation of the floor plan information.
Example:
Upload the floor plan the 4th level of site with ID “1001”:
curl --form username=yourusername --form password=yourpassword --form levelId=4 --form name="Level four" --form desc=Description --form kml=@Floor4.kml --form image=@Floor4.png -X POST https://its.dragonflycv.com/api/v1/sites/1001/floorplans/
At the end of the upload process, you should display:
<code”>{“levelId”:4,”fpId”:”aaaa1111″,”name”:”Level four”,”access”:”private”,”kml”:”https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/1001/aaaa1111_o.kml”,”desc”:”Description”,”kmlAligned”:”https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/1001/aaaa1111_a.kml”}
JSON fields:
- desc: floor plan’s description.
- levelID: level associated to the floor plan.
- kmlAligned: link to a KML file that contains:
- the boundaries of a pre-rotated floor plan image.
- the link to the pre-rotated floor plan image.
- name: floor plan’s name.
- kml: link to the original KML file that contains:
- the boundaries of a north aligned floor plan image.
- the rotation to be applied to the floor plan image.
- the link to the original floor plan image.
- access: private (not relevant).
- fpID: floor plan identification string.
/api/v1/sites/{siteId}/floorplans/{fpId}/
GET
Returns a specific floor plan of a specific site.
Path parameters:
- {siteId}: site identification string.
- {fpId}: floor plan identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8.
- Body: JSON array of the floorplan.
Example:
Returns a JSON representation of the floor plan “aaa1111” for site with site with ID “1001”:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/1001/floorplans/aaaa1111/
The result is an array [{…}, {…}, …] of JSON objects:
{
"desc":"",
"levelId":0,
"kmlAligned":"https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/1001/aaaa1111_a.kml",
"name":"First Floor",
"kml":"https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/1001/aaaa1111_o.kml",
"access":"private",
"fpId":"aaa1111"
}
JSON fields:
- desc: floor plan’s description.
- levelID: level associated to the floor plan.
- kmlAligned: link to a KML file that contains:
- the boundaries of a pre-rotated floor plan image.
- the link to the pre-rotated floor plan image.
- name: floor plan’s name.
- kml: link to the original KML file that contains
- the boundaries of a north aligned floor plan image.
- the rotation to be applied to the floor plan image.
- the link to the original floor plan image.
- access: private (not relevant).
- fpID: floor plan identification string.
DELETE
Remove a specific floor plan from the specific site.
Path parameters:
- {siteId}: site identification string.
- {fpId}: floor plan identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Body: JSON confirmation message.
Example:
Remove the level with floor plan with Id “aaaa1111” from siteId 1001:
curl -u username:password -X DELETE https://its.dragonflycv.com/api/v1/sites/1001/floorplans/aaaa1111/
The result is a confirmation message:
{
"status": "success"
}
https://cvnav.dragonflycv.com/api/v1/sites/{siteId}/dragonfly/devices/
GET
Retrieves several information about all the devices that are running the Dragonfly Application.
Path parameters:
- {siteId}: site identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Header:
- Content-type:application/json; charset=UTF-8.
- Body: JSON array of devices associated to a site.
Example:
Retrieve the user defined objects and the status objects of all the devices registered within site 1001:
curl -u username:password https://cvnav.dragonflycv.com/api/v1/sites/1001/dragonfly/devices/
The result is a JSON like this one:
[
{
"mac": "D430NV3MKHZ2",
"device_status": {
"battery": 42,
"fw_version": "1.1.0",
"received_at": 1480494040577,
"type_of_device": "Dragonfly"
},
"position": {
"siteId": "1013",
"levelId": 11,
"source": "Dragonfly",
"device": "D430NV3MKHZ2",
"fixed_at": 1480494040577,
"lat": 48.88591163127163,
"lng": 2.3138323175893536,
"alt": 1.4480805209161107,
"pitch": -0.6764009718012588,
"yaw": -14.135699033880927,
"roll": -3.208388225538948,
"status": 4
},
"device_type": "D",
"udo": {
"name": "E5823",
"desc": "E5823"
},
"current_server_time": 1480493108326,
"store_position": false
}
]
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: not relevant.
- fw_version: not relevant.
- received_at: timestamp of the last status.
- type_of_device: always “Dragonfly”
- position:
- siteId: site identification.
- levelId: last level identification.
- source: always “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 position fix.
- lat/lng: a pair of latitude/longitude coordinates.
- alt: the altitude in meters.
- yaw, pitch, roll: the orientation of the device – its orientation in space.
- status:
- 0: Not ready
- 1: Idle
- 2: Map Initialization
- 3: Navigation
- 4: Lost
- 5: Mapping
- 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.
- store_position: if the storing of the position is active or not.
About the 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).
Path parameters:
- {siteId}: site identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Body: JSON confirmation message.
Example:
Remove all the devices associates with site the site with ID 1001:
curl -u username:password -X DELETE https://cvnav.dragonflycv.com/api/v1/sites/1001/dragonfly/devices/
The result is a confirmation message:
{
"status": "success"
}
/api/v1/sites/{siteId}/accounts/
GET
Retrieves all the user accounts associated to a site.
Path parameters:
- {siteId}: site identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Body: JSON representation of user accounts associated to a site.
Example:
Retrieves a JSON representation of all the user accounts associated with the site with ID “1001”:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/1001/accounts/
The result is a JSON Object:
[
{
"username":"carlos@domain.net",
"access":10
},
{
"username":"cyril@domain.net",
"access":20
},
{
"username":"gianni@domain.net",
"access":30
},
{
"username":"francesco@domain.net",
"access":30
}
]
JSON fields:
- username: username associated with the site.
- access: access levels for the username registered.
/api/v1/sites/{siteId}/accounts/{accountId}
GET
Retrieves the access level info of a specific account associated to a site.
Path parameters:
- {siteId}: site identification string.
- {accountId}: account identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Body: JSON representation of the user accounts associated to a site.
Example:
Retrieves a JSON representation of the user account “fhofer@onit.it” associated with the site with ID “1001”:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/1001/accounts/francesco@domain.com/
The result is a JSON Object:
[
{
"username":"francesco@domain.com",
"access":10
}
]
JSON fields:
- username: account associated with the site.
- access: access levels for the account.
DELETE
Remove a specific user from the specific site.
Path parameters:
- {siteId}: site identification string.
- {accountId}: account identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Body: JSON confirmation message.
Example:
Remove the account with name “francesco@domain.com site with ID “1001”:
curl -u username:password -X DELETE https://its.dragonflycv.com/api/v1/sites/1001/accounts/francesco@domain.com/
The result is a confirmation message:
{
"status": "success"
}
/api/v1/sites/{siteId}/levels/{levelId}/metadata/
GET
Returns all the geo-fences for a specific level of a site.
Path parameters:
- {siteId}: site identification string.
- {levelId}: level identification string.
Request: no information is passed along with the request.
Response:
- Status: 200 OK.
- Body: JSON confirmation message.
Example:
Returns the JSON representation of the geo-fences related to level “1” of site “1001”:
curl -u username:password https://its.dragonflycv.com/api/v1/sites/1001/levels/1/metadata/
The result is an array [{…}, {…}, …] of JSON objects:
[{
"id": "42",
"levelId": 0,
"behavior": "include",
"name": "my geo-fence",
"class": "geometry",
"lastEdited": 1602147106256,
"type": "area",
"vertexes": [
[
["45.736722", "-0.577394"],
["45.736609", "-0.577539"],
["45.736557", "-0.577375"],
["45.736686", "-0.577309"]
]
]
}]
JSON fields:
-
- id: geo-fence identification number.
-
- levelId: level identification number.
-
- behavior: not relevant at present.
-
- class: not relevant at present.
-
- type: not relevant at present.
-
- vertex: array of coordinates that defines the area.
-
- name: geo-fence name. If no name was specified when creating, will be set to “”.
/api/v1/sites/{siteId}/metadata/
POST Create a new geo-fence inside a specific site. Path parameters:
-
- {siteId}: site identification string.
Request:
-
- Header:
-
- Content-type:application/json.
-
- Header:
-
- Body:
-
- levelID: level identification number.
-
- behavior: set it to “include”.
-
- name: geo-fence name. If no name was specified when creating, will be set to “”.
-
- class: set it to “geometry”.
-
- type: set it to “area”.
-
- vertex: array of coordinates that defines the area.
-
- Body:
Response:
-
- Status: 200 OK.
-
- Header:
-
- Content-type:application/json; charset=UTF-8
-
- Header:
-
- Body: JSON representation of the level.
Example: Create a geo-fence inside site “1001”: curl -u username:password -H 'Content-Type: application/json' -X POST -d '{"levelId":0,"behavior":"exclude","name":"my geo-fence","class":"geometry","type":"area","vertexes":[[["45.736626","-0.577270"],["45.736562","-0.577211"],["45.736611","-0.577155"],["45.736685","-0.577198"]]]}' https://its.dragonflycv.com/api/v1/sites/1001/metadata/
The result is a JSON that describes the geo-fence just created: {
JSON fields:
"id": "15",
"levelId": 1,
"behavior": "exclude",
"name": "my geo-fence",
"class": "geometry",
"type": "area",
"vertexes": [
[
[
"45.736626",
"-0.577270"
],
[
"45.736562",
"-0.577211"
],
[
"45.736611",
"-0.577155"
],
[
"45.736685",
"-0.577198"
]
]
]
}
-
- id: geo-fence identification number.
-
- levelID: level identification number.
-
- behavior: not relevant at present.
-
- name: geo-fence name.
-
- class: not relevant at present.
-
- type: not relevant at present.
-
- vertex: array of coordinates that defines the area.
DELETE Delete all the geo-fences associated to a site. Resource-wide template parameters:
-
- {siteId}: site identification string.
Example: Delete all the geo-fence inside site “1001”: curl -u username:password -X DELETE https://its.dragonflycv.com/api/v1/sites/1001/metadata/
The result is a confirmation message: {
"status": "success"
}
/api/v1/sites/{siteId}/metadata/{metadataId}/
PUT Update an existing geo-fence defined by its ID Path parameters:
-
- {siteId}: site identification string.
-
- {metadataId}: geo-fence identification string.
Request:
-
- Header: don’t add any “Content-type”!
-
- Body:
-
- id: geo-fence identification number.
-
- levelID: level identification number.
-
- behavior: set it to “include”.
-
- name: geo-fence name. If no name was specified when creating, will be set to “”.
-
- class: set it to “geometry”.
-
- type: set it to “area”.
-
- vertex: array of coordinates that defines the area.
-
- Body:
Response:
-
- Status: 200 OK.
-
- Header:
-
- Content-type:application/json; charset=UTF-8
-
- Header:
-
- Body: JSON representation of the updated geo-fence.
Example: Update the geo-fence with ID “1” inside site “1001”: curl -X PUT "https://its.dragonflycv.com/api/v1/sites/1001/metadata/1/" -u username:password -d '{"id":"1","levelId":"3","behavior":"include","name":"Studio2","class":"geometry","type":"area","vertexes":[[["45.656369","9.414533"],["45.656361","9.414573"],["45.656329","9.414562"],["45.656337","9.414520"],["45.656350","9.414525"],["45.656353","9.414510"],["45.656373","9.414518"]]]}'
The result is a JSON that describes the geo-fence just modified: {
JSON fields:
"id":"1",
"levelId":"3",
"behavior":"include",
"name":"Studio2",
"class":"geometry",
"type":"area",
"vertexes":[
[
[
"45.656369",
"9.414533"
],
[
"45.656361",
"9.414573"
],
[
"45.656329",
"9.414562"
],
[
"45.656337",
"9.414520"
],
[
"45.656350",
"9.414525"
],
[
"45.656353",
"9.414510"
],
[
"45.656373",
"9.414518"
]
]
]
}
-
- id: geo-fence identification number.
-
- levelId: level identification number.
-
- behavior: not relevant at present.
-
- class: not relevant at present.
-
- type: not relevant at present.
-
- vertex: array of coordinates that defines the area.
-
- name: geo-fence name. If no name was specified when creating, will be set to “”.
DELETE Delete an existing geo-fence of a specific site. Path parameters:
-
- {siteId}: site identification string.
-
- {metadataId}: geo-fence identification string.
Request: no information is passed along with the request. Response:
-
- Status: 200 OK.
-
- Body: JSON confirmation message.
Example: Delete the geo-fence with ID “15” inside site “1001”: curl -u username:password -X DELETE https://its.dragonflycv.com/api/v1/sites/1001/metadata/15/
The result is a confirmation message: {
"status": "success"
}
https://logger.dragonflycv.com/api/v1/dragonfly/sites/{siteId}/allEnabledDates
GET
To use this call the storage of the historical positions must be activated inside Dragonfly following these instructions.
Returns the list of all dates that have data
Path parameters:
-
- {siteId}: site identification string.
Request: no information is passed along with the request. Response:
-
- Status: 200 OK.
-
- Header:
-
- Content-type:application/json; charset=UTF-8.
-
- Header:
-
- Body: JSON array of dates.
Example: Returns a JSON array of dates between August 2019 and December 2019 for site with ID “1001”: curl -u username:password https://logger.dragonflycv.com/api/v1/dragonfly/sites/1001/allEnabledDates
The result is an array [{…}, {…}, …] of JSON objects:
[
"18/2/2018",
"29/4/2018",
"31/09/2018",
"31/11/2018",
"8/1/2019",
"9/2/2019",
"10/8/2019",
"11/11/2019",
"12/25/2019"
]
https://logger.dragonflycv.com/api/v1/dragonfly/sites/{siteId}/years/{year}/months/{month}/enabledDates
GET
To use this call the storage of the historical positions must be activated inside Dragonfly following these instructions.
Returns the list of dates that have data for:
-
- the current month
-
- the two previous months.
-
- the two next months.
Path parameters:
-
- {siteId}: site identification string.
-
- {year}: year identifier in four digits
-
- {month}: month identifier in two digits.
Request: no information is passed along with the request. Response:
-
- Status: 200 OK.
-
- Header:
-
- Content-type:application/json; charset=UTF-8.
-
- Header:
-
- Body: JSON array of dates.
Example: Returns a JSON array of dates between August 2019 and December 2019 for site with ID “1001”: curl -u username:password https://logger.dragonflycv.com/api/v1/dragonfly/sites/1001/years/2019/months/10/enabledDates
The result is an array [{…}, {…}, …] of JSON objects:
[
“8/1/2019”,
“9/2/2019”,
“10/8/2019”,
“11/11/2019”,
“12/25/2019”
]
https://logger.dragonflycv.com/api/v1/dragonfly/sites/{siteId}/years/{year}/months/{month}/days/{day}/devices
GET
To use this call the storage of the historical positions must be activated inside Dragonfly following these instructions.
Returns a JSON content with the positions of all the devices of a specific site for a specific date.
Path parameters:
-
- {siteId}: site identification string.
-
- {year}: year identifier in four digits
-
- {month}: month identifier in two digits.
-
- {day}: month identifier in two digits.
Request: no information is passed along with the request. Response:
-
- Status: 200 OK.
-
- Header:
-
- Content-type:application/json; charset=UTF-8.
-
- Header:
-
- Body:
-
- If the call is made for the current day – data is still available directly on the logger. Thus, the body of the response contains an array of JSON. Every JSON element of this array corresponds to the position of a device at a specific time. The output is compressed with gzip.
-
- If the call is made for a past date – the output is a temporary link to a file. The file contains an array of JSON. Every JSON element of this array corresponds to the position of a device at a specific time. Note that contrary to the .GZ estension, the file is a plain text file.
-
- Body:
Example: Returns the positions of all the devices logged during 1st August 2019 for site with ID “1001”: curl -u username:password https://logger.dragonflycv.com/api/v1/dragonfly/sites/1001/years/2019/months/08/days/01/devices
The result is a temporary link to the file: {
“url”: “https://s3.eu-central-1.amazonaws.com/onit.its.floorplans/dragonfly/100200/2019/08/01/dragonfly_1001_2019_08_01.json.gz?AWSAccessKeyId=AKIAJLSSDFH7I2IFU4XK5A&Expires=1602180718&Signature=%2FZN%2BvQTIuCzcosdsQWDxD2gDgcs%3D”
}
Opening the file with a text-editor you will find an array of JSON. Every JSON element of this array corresponds to the position of a device at a specific time:
[
JSON fields:
{
"device_status": {
"received_at": 1601987861415,
"type_of_device": "Dragonfly",
"battery": 0,
"fw_version": "unknown"
},
"udo": {
"name": "unknown",
"desc": "unknown"
},
"utc_offset_min": 120,
"store_position": true,
"timezone_label": "Europe/Rome",
"current_server_time": 1601987861415,
"device_type": "D",
"position": {
"lng": 9.414528209713751,
"levelId": 2,
"fixed_at": 1601986689355,
"alt": -0.008289542523210132,
"roll": -115.5093604916345,
"siteId": "100200",
"source": "Dragonfly",
"pitch": 94.11626800160678,
"device": "D834I62S7RT7",
"lat": 45.65633986455605,
"yaw": 6.78184979045937,
"status": 3
},
"mac": "D834I62S7RT7"
},
{
"device_status": {
"received_at": 1601987862427,
"type_of_device": "Dragonfly",
"battery": 0,
"fw_version": "unknown"
},
"udo": {
"name": "unknown",
"desc": "unknown"
},
"utc_offset_min": 120,
"store_position": true,
"timezone_label": "Europe/Rome",
"current_server_time": 1601987862427,
"device_type": "D",
"position": {
"lng": 9.414530386684449,
"levelId": 2,
"fixed_at": 1601986690366,
"alt": 0.041026881615358245,
"roll": -126.42890819503543,
"siteId": "100200",
"source": "Dragonfly",
"pitch": 101.21168784216196,
"device": "D834I62S7RT7",
"lat": 45.6563395042833,
"yaw": 11.133065502114217,
"status": 3
},
"mac": "D834I62S7RT7"
}
]
-
- device status:
-
- received_at: timestamp of the last status.
-
- type_of_device: always “Dragonfly”.
-
- battery: not relevant.
-
- fw_version: not relevant.
-
- device status:
-
- 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.
-
- udo:
-
- utc_offset_min: the minutes of difference from the UTC timezone.
-
- store_position: always “true”.
-
- timezone_label: the name of the timezone.
-
- current_server_time: timestamp of the last status.
-
- device_type: always “D”.
-
- position:
-
- lat/lng: a pair of latitude/longitude coordinates.
-
- levelId: last level identification.
-
- fixed_at: last position fix.
-
- alt: the altitude in meters.
-
- yaw, pitch, roll: the orientation of the device – its orientation in space.
-
- siteId: site identification.
-
- source: always “Dragonfly”.
-
- device: the device unique ID generated by the server. The pseudo MAC address contains a total of 12 characters beginning with a “D”.
-
- status:
-
- 0: Not ready
-
- 1: Idle
-
- 2: Map Initialization
-
- 3: Navigation
-
- 4: Lost
-
- 5: Mapping
-
- status:
-
- position:
-
- mac: the device unique ID generated by the Dragonfly server. The pseudo MAC address contains a total of 12 characters beginning with a “D”.
About the 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.
https://logger.dragonflycv.com/api/v1/dragonfly/sites/{siteId}/deleteData
DELETE
To use this call the storage of the historical positions must be activated inside Dragonfly following these instructions.
Delete all the historical positions of a site.
Path parameters:
-
- {siteId}: site identification string.
Request: no information is passed along with the request. Response:
-
- Status: 200 OK.
-
- Body: JSON confirmation message.
Example: Remove the historical positions saved for siteId 1001: curl -u username:password -X DELETE https://logger.dragonflycv.com/api/v1/dragonfly/sites/1001/deleteData
The result is a confirmation message: {
"status":"success"
}
https://logger.dragonflycv.com/api/v1/dragonfly/sites/{siteId}/years/{year}/months/{month}/days/{day}/deleteData
DELETE
To use this call the storage of the historical positions must be activated inside Dragonfly following these instructions.
Delete the historical positions of a specific date for a site.
Path parameters:
-
- {siteId}: site identification string.
-
- {year}: year identifier in four digits
-
- {month}: month identifier in two digits.
-
- {day}: month identifier in two digits.
Request: no information is passed along with the request. Response:
-
- Status: 200 OK.
-
- Body: JSON confirmation message.
Example: Remove the historical positions for July 8 2020 saved for siteId 1001: <codeclass=”lang:default decode:true”>curl -u username:password -X DELETE https://logger.dragonflycv.com/api/v1/dragonfly/sites/1001/years/2020/months/07/days/08/deleteData The result is a confirmation message: {
"status":"success"
}