Dronesmith Technologies

Dronesmith Developer Hub

Docs      API Reference      API Tutorials
Suggest Edits

Dronesmith API Reference

 

Getting Started

This is the development documentation. Things are subject to change as the API is tested and features are requested and implemented, or removed.

Each request is made to: api.dronesmith.io/api/
All API requests are prefixed with /api/.

All request and response data are marshaled as JSON. Please include “Content-Type” and “application/json” in your request header when sending request data to the API.

A valid user email address and API key are required to use the Dronesmith API. These components must be included with every request made to the API within the request headers.

Your email address should be included in the request headers as “user-email” and your api key as “user-key”. See the example below for more information.

To get an API key, simply go to http://api.dronesmith.io and create an account. Your API key will be sent to you in your confirmation email. You do not need to verify your account to use the API. You can also retrieve your API key at any time by logging into http://api.dronesmith.io and selecting “account” from the status bar.

An easy way to verify you can talk to the Dronesmith API is to simply send a GET request to api.dronesmith.io/api/.

Here is an example request.

Headers:
user-email test@test.com
user-key a1204f04-c2a9-477b-ae20-a8bba455da09

GET /api/

Response:
403 - Forbidden, request failed to authenticate
204 - Success (no response content)

A response code of 204 indicates that you can talk to the Dronesmith API and your email/key were successfully authenticated. All API requests will respond with 403 (Forbidden) if there was a failure to authenticate. Any request path or method made that does not exist in the API will respond with a 404 (Not found) status code.

Successful responses: To retain consistency, all API requests return JSON data. Many responses, especially those of POST, PUT, or DELETE methods do not have any data to send back. These responses will send back the following, case-insensitive vernacular if they have completed a request successfully, but have no further content:

Status code: 200
JSON: {“status”: “OK”}

Error responses: If the API encounter an error handling a request, such as being unable to find a drone object with a specified ID or name, it will return the following:

Status code: 400
JSON: {“error”: “description of error here”}

The API always follow these conventions when dealing successful responses and errors; developers can use these to help determine the outcome of their API request. Please keep in these responses are case insensitive, so parsing for case may be needed, depending on the developer’s implementation.

Suggest Edits

Changelog

 

1.0.04: (2016-12-19)

  • Rebranded Dronesmith Link to Dronesmith Engine.
  • Removed deprecated scripts and assets.
  • Fixed minor UI bugs.

1.0.03: (2016-11-21)

  • Add customizable starting latitude and longitude for virtual drones when creating or starting them.

1.0.02a: (2016-11-16)

  • Local API support.
  • Add note about stopping virtual drones if they have been idle for more than an hour.

1.0.02: (2016-11-10)

  • Minor bug fixes once more.
  • Add “relativePos” and “relativeAlt” to goto and takeoff.
  • Remove GPS lat/lon from land, not applicable in firmware.
  • Add statusCode to command response object.
  • Send a 400 error when trying to query information on a drone that is not online.
  • Make field names in post bodies case insensitive.

1.0.01: (2016-11-03)

  • Various minor bug fixes and improvements.
  • Added groups to drone objects.
  • Added group updates to PUT /api/drone/<id/name>
  • The online field now works when querying a drone.
  • Added query strings to GET /api/drone
Suggest Edits

Local API

 

The API is also be run locally on each drone. To use it, simply run your app within the same Linux environment as Dronesmith Link, and make REST calls to localhost:80/api/drone. Also note that the application does not need to live on the same linux environment. You can have an app running on a separate computer that communicates with the API within a local area network. If you've changed Dronesmith Link's status port to something else, you will need to change the port from 80 to that port accordingly. See our Dronesmith Link section for more details pertaining to the app.

Note: There are two major differences between the local API and the cloud API. The first is that API endpoints do not take a drone name. For instance, to get the status of the drone, you would use GET /api/drone/status rather than GET /api/drone/<name>/status. This applies to all API calls made locally. Secondly, to make a call to the local API, neither api-key, nor user email is required in the headers. There is no authentication in the local API.

Only API endpoints beginning with /api/drone are supported. Calls to /api/mission will return a 404.

Unsupported API endpoints in the Local API:

  • GET /mission
  • GET /mission/<id>
  • DELETE /mission
  • POST /ssh/open
  • POST /ssh/close
  • POST /api/drone
  • POST /api/drone/start
  • POST /api/drone/stop
  • GET /api/drone/<name/id>
  • DELETE /api/drone/<name/id>
  • PUT /api/drone/<name/id>

GET /api/drone does not return a Drone Object. Instead, it returns an OK status in JSON.

Suggest Edits

Anatomy of a Drone Object

 

A Drone Object is the representation of your drone in the API. Every drone object is a unique drone that API requests can be made to gather telemetry information, send commands to, etc. You can think of drone objects as the API’s representation of your physical or virtual drone.

Drone Objects can be created in two ways. First, any physical drone, such as a Luci, that is activated through DS Link properly, will automatically create a drone object associated with that Luci to your account. Secondly, you may create a virtual drone and corresponding object, by using the Virtual Drone API.

Anatomy of a drone object

Every drone object contains the following metadata.

_id <string> <read-only>

The ID field is a unique identifier for a drone object. You can use this as a way to query your drone. Each ID is a string of 24 serialized letters and numbers.

name <string>

The name is a string that serves as an alias for your drone object, making it easier to work with. Your name must be unique for all of your drone objects on your account.

simId <string> <read-only>

If your drone is a virtual drone (see Virtual Drones below) then your drone object will have this field, which serves a unique Id for virtual drones. In general, the simId is not important to the end user, however you can use it as a convenient way of determining if your drone object is tied to a real or virtual drone.

created <date> <read-only>

A UTC date of when this drone object was created.

updated <date> <read-only>

A UTC date of when this drone object was last modified. Keep in mind this is when the drone object was modified, not the actual drone.

systemId <number>

Represents the drone object’s MAVLink ID number. Is 1 by default. Generally does not need to be modified.

online <boolean>

True if the drone is currently communicating with the API, false otherwise.

type <string>

Is “Drone” when the drone object represents a physical drone. Is “Virtual Drone” when the drone object represents a virtual drone. You are free modify this type field for your own needs, such as classifying swarm drone groups.

firmwareId <string> <read-only>

A unique Id generated by physical drones from DS Link. This is “unknown” on virtual drones.

missions <array> <read-only>

A list of mission objects that your drone has uploaded. See Mission Objects for more details.

sensors <object> <read-only>

A set of user-defined sensors with their values. These allow users to upload their own custom sensor information, either locally from their drone using DS Link, or from another source. See User Defined Sensors section.

groups <array>

An array of strings of groups the drone is associated with. Groups serve as easy ways to logically organize drones.

 

All API endpoints beginning with drone have will have the syntax:
/api/drone/{name|id}/<endpoint>

Where {name|id} is the name or id of the drone, and <endpoint> is the name of the API request. In these cases, you can specify a drone by using its ID or name. The ID corresponds to the drone object’s ID, and name corresponds to its name. For virtual drones, a name is always generated, but for real drones, a name must be updated to the drone object via a PUT request (see API below). All endpoints beginning with /api/drone follow this convention.

Suggest Edits

Offline Drones

 

If the drone is no longer connected or responding to the API, any calls made to:

/api/drone/<id/name>/:endpoint

Will return a 400 status error indicating the drone is not online.

Suggest Edits

/api/drone/

Get all drones or filter by query strings.

 
gethttp://cloud.dronesmith.io/api/drone
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Get drone objects
response = requests.get('http://api.dronesmith.io/api/drone?groups=simdrones-2&type=Virtual Drone', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Get drone objects
response = requests.get('http://api.dronesmith.io/api/drone', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "total": 2,
  "size": 2,
  "page": null,
  "drones": [
    {
      "id": "582b43abcc704876c19dc30f",
      "name": "nauseous_mestorf",
      "simId": "9f3a686cdd955809fb14d99d90095c2fb6ec232cb6171f6fe59f6077da4ef907",
      "created": "2016-11-15T17:19:39.379Z",
      "updated": "2016-11-15T18:52:20.096Z",
      "systemId": 1,
      "online": true,
      "type": "Virtual Drone",
      "firmwareId": "unknown",
      "missions": [
        "582b4425fcdd9377303bfcc1"
      ],
      "groups": [
        "simdrones-2"
      ]
    },
    {
      "id": "582b56b8cc704876c19dc311",
      "name": "furious_cray",
      "simId": "ac9998ecd85c973368b6c04089c6b67af66aa23e060af4501b72969c5236d83a",
      "created": "2016-11-15T18:40:56.669Z",
      "updated": "2016-11-15T18:40:56.669Z",
      "systemId": 1,
      "online": false,
      "type": "Virtual Drone",
      "firmwareId": "unknown",
      "missions": [],
      "groups": [
        "simdrones-2"
      ]
    }
  ]
}

Query Params

size
string

The number of missions to include in the object. Default is 10 if no size is specified.

page
string

The offset to return. Only applicable if size has been set. For instance, a size of 10 with a page of 2 would return missions starting from 10 * (2-1) = 10 to 20.

sort
string

Order the missions by a field. Use a dash - (minus) to specify an inverted ordering.

groups
string

Select drone objects by groups. You can select mutliple groups by separting each with a comment. Ex: ?groups=swarm-23,vegas,px4

{field}
string

Select drone objects by generic field name in drone object, with a specific value. Ex: ?type=Virtual Drone&systemId=1

 

Description

Lists all drone objects a user account has as a JSON array. See Anatomy of a Drone Object Anatomy of a Drone Object for more information.

Returned Fields

Total - total number of missions
Size - Number of returned missions
Page - the specified page. Null if page is not applicable.
Missions - The mission object.

Suggest Edits

/api/drone/{name|id}

 
gethttp://cloud.dronesmith.io/api/drone/name|id
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Get drone object
response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "id": "5825faa7305eff4b19b1f7ab",
  "name": "prickly_galileo",
  "simId": "8c526a1b2ea9d95ecff4750f38895246506882c5f83bee0915d826a64cf6305d",
  "created": "2016-11-11T17:06:47.148Z",
  "updated": "2016-11-11T17:06:47.148Z",
  "systemId": 1,
  "online": false,
  "type": "Virtual Drone",
  "firmwareId": "unknown",
  "missions": [],
  "groups": []
}
{
  "error": "No drone found."
}

Path Params

name|id
string
required

Either your drone’s unique ID, or its custom name.

 

Description

Returns information for a single drone object in a user’s account. See Anatomy of a Drone Object for more information.

Suggest Edits

/api/drone/{name|id}

 
deletehttp://cloud.dronesmith.io/api/drone/name|id
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Delete drone 
response = requests.delete('http://api.dronesmith.io/api/drone/'+ DRONE_NAME, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "status": "OK"
}
{
  "error": "No drone found."
}

Path Params

name|id
mixed type
required

Either your drone’s unique ID, or its custom name.

 

Description

Delete a drone object in your account. If this is a virtual drone, this forcefully terminates it and deletes all associated metadata. For a real drone, it only deletes associated metadata. If the real drone is successfully authenticated with the API, the next time it is online, a new drone object will be created. You must log out of your drone via DS Link to completely remove the drone object. This may take a few seconds for the request to send a response.

Suggest Edits

/api/drone/{name|id}

 
puthttp://cloud.dronesmith.io/api/drone/name|id
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'nauseous_mestorf'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Add group to drone
response = requests.put('http://api.dronesmith.io/api/drone/'+ DRONE_NAME, json={
    
	"groups": {
		"$set": ["simdrones-2"]
	}
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Change drone name field
response = requests.put('http://api.dronesmith.io/api/drone/'+ DRONE_NAME, json={
    
	"name": "Falcon"
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "status": "OK"
}
{
  "error": "No drone found."
}

Path Params

name|id
string
required

Either your drone’s unique ID, or its custom name.

 

Description

Update metadata in your drone object on all fields that are not read-only. See Anatomy of a Drone Object for more information.

Using Groups

There is a special rule for updating groups in a drone object.

To update a group object, you must use an object, and preface it with one of the three fields: $set, $push, $pull. Then, include the array of groups. The field dictates how you wish to modify the group. You can have multiple $set, $push, and $pull operations in your group field, but the behavior of how it will affect the groups is undefined, as it depends on how the JSON object is iterated, which is arbitrary and implementation dependent. It is recommended to only use one of these fields per group update at a time.

Set

$set is used to do a fresh update on a group. This removes the existing group names and add the new group names, or if an empty array is used, no groups.

Example:
Old Drone object: {groups: [swarm-12, vegas]}
Update value: groups: {$set: [swarm-32, kansas, multirotor] }
New value: {groups: [swarm-32, kansas, multirotor]}

Pull

$pull is used to remove groups from a drone object. Any groups in the drone object that matches the array specified by $pull will be removed. If there is no match, no change is made.

Example:
Old Drone object: {groups: [swarm-12, vegas]}
Update value: groups: {$pull: [swarm-32, vegas] }
New value: {groups: [swarm-12]}

Push

$push is used to add groups to a drone object. Any groups in the drone object that matches the array specified by $pull will be added. Existing groups remain unchanged.

Example:
Old Drone object: {groups: [swarm-12, vegas]}
Update value: groups: {$push: [swarm-32, vegas] }
New value: {groups: [swarm-12, swarm-32, vegas]}

Suggest Edits

Telemetry

 

To collect basic information about your drone while it’s running, such as where it’s located, what orientation it’s at, etc, send one of the following GET requests.

All request have the following structure:

     GET        /api/drone/{name|id}/{telemetry}

<name/id>

Either your drone’s unique ID, or its custom name.

<telemetry>

The requested telemetry information.

gethttp://cloud.dronesmith.io/api/drone/name|id/info
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/info', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Type": "Quadrotor",
  "Firmware": "PX4",
  "Protocol": "MAVLink v3",
  "LastUpdate": "2016-11-15T19:50:54.903248141Z",
  "LastOnline": "2016-11-15T19:50:54.074823885Z"
}
{
  "error": "Drone not online."
}
 

Description

Returns basic information about your drone.

Type

The kind of drone this is. Examples include:
Quadrotor
Hexrotor
Fixed Wing
VTOL (vertical takeoff and land)

Firmware

The underlying flight control software. Examples include PX4, APM.

Protocol

The communications protocol. Currently only MAVLink is supported.

LastUpdate

A timestamp of when the last message was received.

LastOnline

A timestamp of when the drone last signed on with the API.

 
gethttp://cloud.dronesmith.io/api/drone/name|id/status
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/status', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Online": true,
  "Armed": false,
  "State": "Standby",
  "VTOLMode": "Not a VTOL vehicle",
  "InAir": false,
  "Power": 100
}
{
  "error": "Drone not online."
}
 

Description

Returns current information about your drone.

Online

true if the drone’s datalink is active, false otherwise. Please note that this field represents the datalink between the drone and DS Link, the translator that communicates with the API. If, for instance, the online is false, this indicates that DS Link is communicating with the API, but the drone itself is not communicating with DS Link.

Armed

true if the drone’s motors are enabled to spin, 'false' if a drone’s motors are locked, preventing it from flying.

State

The drone’s current flight state. The following are a list of states:
“Initializing” - Drone is currently starting up.
“Calibrating” - Drone is in a calibration mode.
“Standby” - Drone is awaiting commands.
“Active” - Drone is armed and flying.
“Failsafe” - Drone encountered an error is performing a failsafe operation, such as an emergency landing.

VTOLMode

Applies the VTOL (Vertical takeoff / land) drones only. Indicates if the vehicle is operating as a fixed wing or multirotor vehicle, or transitioning between such.

InAir

true if the drone has not detected any surface. When the drone detects a surface below it, this setting is false.

Power

the drone’s current battery level as a percent. By default, the drone will enter a failsafe mode when the battery is below 17%. Virtual drones will simulate battery life, however, they will hold a drone’s power at 17% to avoid entering failsafe mode.

gethttp://cloud.dronesmith.io/api/drone/name|id/mode
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/mode', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

"Manual"
{
  "error": "Drone not online."
}
 

Description

Current operating mode of the drone. Default value is “manual.” This setting can be changed with the POST /mode API request. The following are a list of modes:

Manual

Drone may be controlled with a standard RC controller, or with POST /input commands. No position or altitude holding is done.

Altitude

Drone may be controlled with a standard RC controller, or with POST /input commands. The throttle RC input is relative to altitude.

Position

Drone may be controlled with a standard RC controller, or with POST /input commands. All RC input is relative to the drone’s position and altitude.

Takeoff

Drone is currently in an automated takeoff mode. Set when POST /takeoff is requested. Remains in takeoff mode until a new command is issued.

Hold

Drone is currently moving to a position and will hold at that location. Set when POST /goto is requested.

Land

Drone is currently landing at a specified location. Set when POST /land is requested. Remains in land mode until a new command is issued.

RTL or RTGS

Drone is currently in failsafe mode.

gethttp://cloud.dronesmith.io/api/drone/name|id/gps
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/gps', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Satellites": 10,
  "Latitude": 47.39774,
  "Longitude": 8.545593,
  "Altitude": 488.104
}
{
  "error": "Drone not online."
}
 

Description

Gets the drone’s GPS position.

Satellites

Number of GPS satellites the drone’s GPS has detected. Useful for verifying GPS signal strength.

Lattitude

Global position in degrees latitude.

Longitude

Global position in degrees longitude.

Altitude

Mean atmospheric sea level altitude in meters relative to the drone’s global position. Basically, the average elevation from sea level in meters of the ground area the drone is in.

Suggest Edits

/attitude

 
gethttp://cloud.dronesmith.io/api/drone/name|id/attitude
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/attitude', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Roll": -1.8285842,
  "Pitch": -1.2411544,
  "Yaw": 3.5657773
}
{
  "error": "Drone not online."
}
 

Description

Gets the drone’s orientation. The range is -180 to 180 degrees Pitch and roll are relative to Earth’s surface, with 0 being balanced. Yaw is relative to Earth’s north pole, with 0 pointing directly north.

Suggest Edits

/position

 
gethttp://cloud.dronesmith.io/api/drone/name|id/position
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/position', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "X": 0.004026684,
  "Y": -0.02161496,
  "Z": -0.11607925,
  "Latitude": 47.39774,
  "Longitude": 8.545593,
  "Altitude": 0.047,
  "Heading": 3.95
}
{
  "error": "Drone not online."
}
 

Description

Gets the drone’s current position. X, Y, and Z are the drone’s local position, relative to where its home location is, in meters. Latitude and longitude are the drone’s global position, same as GET /gps. Altitude is the drone’s relative altitude from the ground in meters. Heading is the drone’s attitude from 0 to 360 degree, where 0 points to Earth’s north pole.

 
gethttp://cloud.dronesmith.io/api/drone/name|id/motors
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/motors', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

[
  1505,
  1510,
  1502,
  1511,
  1500,
  1500,
  0,
  0
]
{
  "error": "Drone not online."
}
 

Description

Gets the current PWM (the raw signal that goes to the motor) values being sent to the drone. The array represents the PWM value of each motor channel.

gethttp://cloud.dronesmith.io/api/drone/name|id/rates
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/rates', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Airspeed": 0,
  "Groundspeed": 0.030534232,
  "Throttle": 0,
  "Climb": 0.0637856
}
{
  "error": "Drone not online."
}
 

Description

Returns the speed (rates) of the drone.

Airspeed - the drone’s measured airspeed. Normally 0 on multirotors, as they lack an airspeed sensor.

Groundspeed - the drone’s velocity relative to the ground in meters per second.

Throttle - the drone’s throttle value, a measurement of input force from 0 (no throttle) to 100 (maximum possible throttle).

Climb - the drone’s climb rate in meters per second. Negative value indicates the drone is moving downward, and positive indicates the drone is moving upward.

 
gethttp://cloud.dronesmith.io/api/drone/name|id/target
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/target', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Attitude": [
    0.9998333,
    -0.015781825,
    -0.009177716,
    -0.00014486528
  ],
  "Thrust": 0.51647764,
  "X": -0.26571134,
  "Y": -0.04804241,
  "Z": -20.066833,
  "Latitude": 47.39774,
  "Longitude": 8.545593,
  "Altitude": 508.104
}
{
  "error": "Drone not online."
}
 

Description

Target represents a set of values the drone wants to reach. These are the control values.

Attitude - The intended attitude target; the orientation the drone would like to be at. Expressed as a quaternion.

Thrust - The intended thrust vector.

X, Y, Z - the drone’s target local position, relative to home position.

Latitude / Longitude - The drone’s target global position.

Altitude - The drone’s target relative altitude.

 
gethttp://cloud.dronesmith.io/api/drone/name|id/sensors
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/sensors', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "AccX": -0.27144316,
  "AccY": 0.24669562,
  "AccZ": -9.84977,
  "GyroX": -0.007041006,
  "GyroY": -0.0033752206,
  "GyroZ": -0.0016560211,
  "MagX": 0.18976593,
  "MagY": 0.026640372,
  "MagZ": -0.40200245,
  "Baro": 0.104980275,
  "Temp": 32
}
{
  "error": "Drone not online."
}
 

Description: Gets the raw sensor values from the drone’s Inertial Measurement Unit (IMU).

AccX/Y/Z - The accelerometer’s X, Y, and Z measurements, in milli-Gs (a G is 9.8 meters per second squared, or the acceleration of Earth’s gravity). The range is typically 4G’s, but changes from drone to drone.

GyroX/Y/Z - The gyroscope’s X, Y, and Z measurements, in milliradians per second. The range is typically 6mrad, but changes depending on the drone’s implementation.

MagX/Y/Z - The magnometer (compass) measurements, in milliguass. The range is typically 8milligauss, but changes depending on the drone’s implementation.

Baro - The measurement of the drone’s barometric pressure unit, in millibars. It should be noted that the barometer is notoriously bad for measuring altitude, and direct measurement should be avoided.

Temp - The IMU’s operating temperature in degrees celsius, if available.

gethttp://cloud.dronesmith.io/api/drone/name|id/home
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/home', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "X": 0.0000022542315,
  "Y": -0.0000025720442,
  "Z": -0.068796135,
  "Latitude": 47.39774,
  "Longitude": 8.545593,
  "Altitude": 488.104
}
{
  "error": "Drone not online."
}
 

Description

The drone’s home location, in global and local coordinates. The home is set by the drone’s initial location when it turns on but can be changed with a POST /home command.

gethttp://cloud.dronesmith.io/api/drone/name|id/log
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/log', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  {
    "Msg": "[inav] GPS signal found",
    "Time": "2016-10-28T13:03:13.857225257-04:00",
    "Level": 6
  },
  {
    "Msg": "[inav] init ref: 47.3977418, 8.5455939, 488.1040",
    "Time": "2016-10-28T13:03:14.839179169-04:00",
    "Level": 6
  }
}
{
  "error": "Drone not online."
}
 

Description

An output of the drone’s status log. The array contains a set of objects with the message, the time it came, and the level, which determines its importance. The higher the level the more important the message is. A maximum of 200 log entries is retained. If there are more than 200 log entries, the oldest are removed. Once you have queried /log, the entries are dequeued, so the next request will not contain the previous entries.

gethttp://cloud.dronesmith.io/api/drone/name|id/input
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/info', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Channels": [
    1500, 1500, 1750, 1500, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 		65535, 65535, 65535, 65535
  ],
  "Signal": 100,
  "Type": "Radio Control"
}
{
  "error": "Drone not online."
}
 

Description

Gets the current input information that was last sent to the drone via a POST /input message. Currently, only radio is supported. The channels represent the raw radio control values, from 1000 - 2000. A value of 65535 indicates there is no input being sent on that channel.

Suggest Edits

Virtual Drones

 

To make development easier, Dronesmith provides virtual drones and virtual Linux environments for developers to work with.

What is a virtual drone?

A virtual drone is a drone that runs a simulated environment. For all intents and purposes, the drone functions exactly like a real drone, only virtual drones have unlimited battery life, and lack any of the problems that makes working with real drones difficult. They are useful for developers who need to implement higher level solutions before going to hardware. Each virtual drone comes with a fake GPS and Optical Flow unit to ease development.

Inactive Drones

Due to the high performance demand of virtual drones, any drone that has been running for more than an hour with no API activity will be shut down. This does not remove your virtual drone object you have created, but it will require you to restart your drone by running POST /api/<drone-name>/start

 
posthttp://cloud.dronesmith.io/api/drone/name
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Create a virtual drone with a random name
response = requests.post('http://api.dronesmith.io/api/drone', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "_id": "582b471bdf80662425265594",
  "__v": 0,
  "simId": "917399da65f9e11c16360d109afab141ae275cbb5457e703f82f8a701d767141",
  "missions": [],
  "online": false,
  "firmwareId": "unknown",
  "type": "Virtual Drone",
  "updated": "2016-11-15T17:34:19.957Z",
  "created": "2016-11-15T17:34:19.957Z",
  "systemId": 1,
  "name": "modest_archimedes"
}

Body Params

lat
double

The starting latitude location of the drone.

lon
double

The starting longitude location of the drone.

 

<name> <optional>

An optional name. Must be unique. This will be the name of your new virtual drone.

Description

Creates a virtual environment and Drone Object associated with it and initializes it with a specified location if one is entered. Please note this request may take a few seconds to complete. The drone exists in a virtual Linux environment. You may access this Linux environment using the SSH API. Returns the newly created Drone Object if successful. You can delete virtual drones by sending a DELETE request to the associated Drone Object. In order to begin using your virtual drone, you must send the /start request.

Suggest Edits

/{name|id}/start

 
posthttp://cloud.dronesmith.io/api/drone/name|id/start
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'modest_archimedes'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Start a virtual drone
response = requests.post('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/start', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "status": "OK"
}
{
  "error": "Drone is already running."
}
{
  "error": "Could not find drone with name or id: modest_archimedes"
}

Body Params

lat
double

The starting latitude location of the drone.

lon
double

The starting longitude location of the drone.

 

<name> <optional>

An optional name. Must be unique. This will be the name of your new virtual drone.

Description

Initializes the virtual drone’s Linux environment, allowing it to begin running. You must call this after creating a virtual drone to begin using it. This may take a few seconds for the request to send a response.

Suggest Edits

/{name|id}/stop

 
posthttp://cloud.dronesmith.io/api/drone/name|id/stop
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'modest_archimedes'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Stop a virtual drone
response = requests.post('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/stop', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "status": "OK"
}
{
  "error": "Drone already stopped."
}
{
  "error": "Could not find drone with name or id: modest_archimedes"
}
 

<name> <optional>

An optional name. Must be unique. This will be the name of your new virtual drone.

Description

Stops virtual drone’s Linux environment. This does not destroy your virtual drone object, but it will remove any flight related data that has not synced to the cloud. Sending a stop then start request effectively restarts your virtual drone. This can be useful as a reset if the virtual drone has been misconfigured or has crashed a flight and is unable to takeoff.

Suggest Edits

Parameters

 

Parameters are the configuration settings of your drone. These allow you to configure your drone for various different flight settings, they are typically an important part of the setup procedure. The Parameters API allows you to set and get parameters without directly interfacing with your drone.

List of PX4 Parameters

Due to the structure of parameters and the way that they are loaded, the API cannot guarantee that all params will always be loaded during initialization without perpetually requesting them from the drone infinitely. The API reports any params that it failed to load by their index numbers

 
gethttp://cloud.dronesmith.io/api/drone/name|id/params
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Get drone parameters
response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/params', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "current": 399,
  "missing": null,
  "params": {
    "ATT_ACC_COMP": 0,
    "ATT_BIAS_MAX": 0.05,
    "ATT_EXT_HDG_M": 0,
    "ATT_MAG_DECL": 0,
    "ATT_MAG_DECL_A": 0,
    "ATT_VIBE_THRESH": 0.2,
    "ATT_W_ACC": 0.2,
    "ATT_W_EXT_HDG": 0.1,
    "ATT_W_GYRO_BIAS": 0.1,
    "ATT_W_MAG": 0.1,
    "BAT_A_PER_V": 15.39103,
    "BAT_CAPACITY": -1,
    "BAT_CNT_V_CURR": 0.00080566405,
    "BAT_CNT_V_VOLT": 0.00080566405,
    "BAT_CRIT_THR": 0.07,
    "BAT_LOW_THR": 0.15,
    "BAT_N_CELLS": 0,
    "BAT_SOURCE": 0,
    "BAT_V_CHARGED": 4.05,
    "BAT_V_DIV": 10.177939,
    "BAT_V_EMPTY": 3.4,
    "BAT_V_LOAD_DROP": 0.3,
    "BAT_V_OFFS_CURR": 0,
    "CAL_ACC0_ID": 0.0000000000,
    "CAL_ACC0_XOFF": 0.01,
    "CAL_ACC0_XSCALE": 1.01,
    "CAL_ACC0_YOFF": -0.01,
    "CAL_ACC0_YSCALE": 1.01,
    "CAL_ACC0_ZOFF": 0.01,
    "CAL_ACC0_ZSCALE": 1.01,
    "CAL_ACC1_ID": 0.0000000000,
    "CAL_ACC1_XOFF": 0.01,
    "CAL_ACC1_XSCALE": 1,
    "CAL_ACC1_YOFF": 0,
    "CAL_ACC1_YSCALE": 1,
    "CAL_ACC1_ZOFF": 0,
    "CAL_ACC1_ZSCALE": 1,
    "CAL_ACC_PRIME": 0,
    "CAL_BARO_PRIME": 0,
    "CAL_GYRO0_ID": 0.0000000000,
    "CAL_GYRO0_XOFF": 0.01,
    "CAL_GYRO0_XSCALE": 1,
    "CAL_GYRO0_YOFF": 0,
    "CAL_GYRO0_YSCALE": 1,
    "CAL_GYRO0_ZOFF": 0,
    "CAL_GYRO0_ZSCALE": 1,
    "CAL_GYRO_PRIME": 0,
    "CAL_MAG0_ID": 0.000000000,
    "CAL_MAG0_ROT": 0,
    "CAL_MAG0_XOFF": 0.01,
    "CAL_MAG0_XSCALE": 1,
    "CAL_MAG0_YOFF": 0,
    "CAL_MAG0_YSCALE": 1,
    "CAL_MAG0_ZOFF": 0,
    "CAL_MAG0_ZSCALE": 1,
    "CAL_MAG1_ID": 0,
    "CAL_MAG1_ROT": 0,
    "CAL_MAG2_ID": 0,
    "CAL_MAG2_ROT": 0,
    "CAL_MAG_PRIME": 0,
    "CAL_MAG_SIDES": 0.00000,
    "CBRK_AIRSPD_CHK": 0,
    "CBRK_ENGINEFAIL": 0.000000000,
    "CBRK_FLIGHTTERM": 0.000000000,
    "CBRK_GPSFAIL": 0.000000000,
    "CBRK_NO_VISION": 0,
    "CBRK_RATE_CTRL": 0,
    "CBRK_SUPPLY_CHK": 0,
    "CBRK_USB_CHK": 0,
    "COM_ARM_WO_GPS": 0,
    "COM_AUTOS_PAR": 0,
    "COM_DISARM_LAND": 0,
    "COM_DL_LOSS_T": 0.00000,
    "COM_DL_REG_T": 0,
    "COM_EF_C2T": 5,
    "COM_EF_THROT": 0.5,
    "COM_EF_TIME": 10,
    "COM_FLTMODE1": 0,
    "COM_FLTMODE2": 0,
    "COM_FLTMODE3": 0,
    "COM_FLTMODE4": 0,
    "COM_FLTMODE5": 0,
    "COM_FLTMODE6": 0,
    "COM_HOME_H_T": 5,
    "COM_HOME_V_T": 10,
    "COM_LOW_BAT_ACT": 0,
    "COM_OBL_ACT": 0,
    "COM_OBL_RC_ACT": 0,
    "COM_OF_LOSS_T": 5,
    "COM_RC_ARM_HYST": 0.0000000,
    "COM_RC_IN_MODE": 0,
    "COM_RC_LOSS_T": 0.5,
    "EKF2_REC_RPL": 0,
    "FW_AIRSPD_TRIM": 15,
    "FW_ARSP_MODE": 0,
    "FW_CLMBOUT_DIFF": 10,
    "FW_THR_CRUISE": 0.6,
    "GF_ACTION": 0,
    "GF_ALTMODE": 0,
    "GF_COUNT": 0,
    "GF_MAX_HOR_DIST": 0,
    "GF_MAX_VER_DIST": 0,
    "GF_SOURCE": 0,
    "INAV_DELAY_GPS": 0.2,
    "INAV_DISAB_MOCAP": 0,
    "INAV_FLOW_DIST_X": 0,
    "INAV_FLOW_DIST_Y": 0,
    "INAV_FLOW_K": 1.35,
    "INAV_FLOW_Q_MIN": 0.3,
    "INAV_LAND_DISP": 0.7,
    "INAV_LAND_T": 3,
    "INAV_LAND_THR": 0.2,
    "INAV_LIDAR_ERR": 0.2,
    "INAV_LIDAR_EST": 0,
    "INAV_LIDAR_OFF": 0,
    "INAV_W_ACC_BIAS": 0.05,
    "INAV_W_GPS_FLOW": 0.1,
    "INAV_W_MOC_P": 10,
    "INAV_W_XY_FLOW": 0.8,
    "INAV_W_XY_GPS_P": 1,
    "INAV_W_XY_GPS_V": 2,
    "INAV_W_XY_RES_V": 0.5,
    "INAV_W_XY_VIS_P": 7,
    "INAV_W_XY_VIS_V": 0,
    "INAV_W_Z_BARO": 0.5,
    "INAV_W_Z_GPS_P": 0.005,
    "INAV_W_Z_GPS_V": 0,
    "INAV_W_Z_LIDAR": 3,
    "INAV_W_Z_VIS_P": 5,
    "LNDMC_FFALL_THR": 2,
    "LNDMC_FFALL_TTRI": 0.3,
    "LNDMC_ROT_MAX": 20,
    "LNDMC_XY_VEL_MAX": 1.5,
    "LNDMC_Z_VEL_MAX": 0.7,
    "MAV_BROADCAST": 0,
    "MAV_COMP_ID": 0,
    "MAV_FWDEXTSP": 0,
    "MAV_PROTO_VER": 0,
    "MAV_RADIO_ID": 0,
    "MAV_SYS_ID": 0,
    "MAV_TEST_PAR": 0,
    "MAV_TYPE": 0,
    "MAV_USEHILGPS": 0,
    "MC_ACRO_P_MAX": 360,
    "MC_ACRO_R_MAX": 360,
    "MC_ACRO_Y_MAX": 360,
    "MC_PITCHRATE_D": 0.003,
    "MC_PITCHRATE_FF": 0,
    "MC_PITCHRATE_I": 0.1,
    "MC_PITCHRATE_MAX": 220,
    "MC_PITCHRATE_P": 0.3,
    "MC_PITCH_P": 5.5,
    "MC_PITCH_TC": 0.2,
    "MC_RATT_TH": 1,
    "MC_ROLLRATE_D": 0.003,
    "MC_ROLLRATE_FF": 0,
    "MC_ROLLRATE_I": 0.1,
    "MC_ROLLRATE_MAX": 220,
    "MC_ROLLRATE_P": 0.3,
    "MC_ROLL_P": 5.5,
    "MC_ROLL_TC": 0.2,
    "MC_TPA_BREAK": 1,
    "MC_TPA_SLOPE": 1,
    "MC_YAWRATE_D": 0,
    "MC_YAWRATE_FF": 0,
    "MC_YAWRATE_I": 0.1,
    "MC_YAWRATE_MAX": 200,
    "MC_YAWRATE_P": 0.2,
    "MC_YAWRAUTO_MAX": 45,
    "MC_YAW_FF": 0.5,
    "MC_YAW_P": 2.8,
    "MIS_ALTMODE": 0,
    "MIS_DIST_1WP": 900,
    "MIS_LTRMIN_ALT": 1.2,
    "MIS_ONBOARD_EN": 0,
    "MIS_TAKEOFF_ALT": 2.5,
    "MIS_YAWMODE": 0,
    "MIS_YAW_ERR": 12,
    "MIS_YAW_TMT": -1,
    "MPC_ACC_HOR_MAX": 5,
    "MPC_ALTCTL_DY": 0,
    "MPC_ALTCTL_DZ": 0.1,
    "MPC_ALT_MODE": 0,
    "MPC_HOLD_MAX_XY": 0.8,
    "MPC_HOLD_MAX_Z": 2,
    "MPC_HOLD_XY_DZ": 0.1,
    "MPC_LAND_SPEED": 0.5,
    "MPC_MANTHR_MAX": 0.9,
    "MPC_MANTHR_MIN": 0.08,
    "MPC_MAN_P_MAX": 35,
    "MPC_MAN_R_MAX": 35,
    "MPC_MAN_Y_MAX": 200,
    "MPC_THR_HOVER": 0.5,
    "MPC_THR_MAX": 0.9,
    "MPC_THR_MIN": 0.12,
    "MPC_TILTMAX_AIR": 45,
    "MPC_TILTMAX_LND": 12,
    "MPC_TKO_SPEED": 1.5,
    "MPC_VELD_LP": 5,
    "MPC_XY_CRUISE": 5,
    "MPC_XY_FF": 0.5,
    "MPC_XY_P": 0.95,
    "MPC_XY_VEL_D": 0.01,
    "MPC_XY_VEL_I": 0.2,
    "MPC_XY_VEL_MAX": 8,
    "MPC_XY_VEL_P": 0.15,
    "MPC_Z_FF": 0.5,
    "MPC_Z_P": 1,
    "MPC_Z_VEL_D": 0,
    "MPC_Z_VEL_I": 0.15,
    "MPC_Z_VEL_MAX": 1,
    "MPC_Z_VEL_MAX_DN": 1,
    "MPC_Z_VEL_MAX_UP": 3,
    "MPC_Z_VEL_P": 0.8,
    "NAV_ACC_RAD": 12,
    "NAV_AH_ALT": 600,
    "NAV_AH_LAT": -2.0733558e+29,
    "NAV_AH_LON": 18197368000000000,
    "NAV_DLL_ACT": 0,
    "NAV_DLL_AH_T": 120,
    "NAV_DLL_CHSK": 0,
    "NAV_DLL_CH_ALT": 600,
    "NAV_DLL_CH_LAT": -2.0309848e+29,
    "NAV_DLL_CH_LON": 18263167000000000,
    "NAV_DLL_CH_T": 120,
    "NAV_DLL_N": 0,
    "NAV_FT_DST": 8,
    "NAV_FT_FS": 0,
    "NAV_FT_RS": 0.5,
    "NAV_FW_ALT_RAD": 10,
    "NAV_GPSF_LT": 30,
    "NAV_GPSF_P": 0,
    "NAV_GPSF_R": 15,
    "NAV_GPSF_TR": 0.7,
    "NAV_LOITER_RAD": 50,
    "NAV_MC_ALT_RAD": 3,
    "NAV_MIN_FT_HT": 8,
    "NAV_RCL_ACT": 0,
    "NAV_RCL_LT": 120,
    "PWM_AUX_DISARMED": 0.0000000,
    "PWM_AUX_MAX": 0.0000000,
    "PWM_AUX_MIN": 0.0000000,
    "PWM_DISARMED": 0,
    "PWM_MAX": 0.0000000,
    "PWM_MIN": 0.0000000,
    "RC10_DZ": 0,
    "RC10_MAX": 2000,
    "RC10_MIN": 1000,
    "RC10_REV": 1,
    "RC10_TRIM": 1500,
    "RC11_DZ": 0,
    "RC11_MAX": 2000,
    "RC11_MIN": 1000,
    "RC11_REV": 1,
    "RC11_TRIM": 1500,
    "RC12_DZ": 0,
    "RC12_MAX": 2000,
    "RC12_MIN": 1000,
    "RC12_REV": 1,
    "RC12_TRIM": 1500,
    "RC13_DZ": 0,
    "RC13_MAX": 2000,
    "RC13_MIN": 1000,
    "RC13_REV": 1,
    "RC13_TRIM": 1500,
    "RC14_DZ": 0,
    "RC14_MAX": 2000,
    "RC14_MIN": 1000,
    "RC14_REV": 1,
    "RC14_TRIM": 1500,
    "RC15_DZ": 0,
    "RC15_MAX": 2000,
    "RC15_MIN": 1000,
    "RC15_REV": 1,
    "RC15_TRIM": 1500,
    "RC16_DZ": 0,
    "RC16_MAX": 2000,
    "RC16_MIN": 1000,
    "RC16_REV": 1,
    "RC16_TRIM": 1500,
    "RC17_DZ": 0,
    "RC17_MAX": 2000,
    "RC17_MIN": 1000,
    "RC17_REV": 1,
    "RC17_TRIM": 1500,
    "RC18_DZ": 0,
    "RC18_MAX": 2000,
    "RC18_MIN": 1000,
    "RC18_REV": 1,
    "RC18_TRIM": 1500,
    "RC1_DZ": 10,
    "RC1_MAX": 2000,
    "RC1_MIN": 1000,
    "RC1_REV": 1,
    "RC1_TRIM": 1500,
    "RC2_DZ": 10,
    "RC2_MAX": 2000,
    "RC2_MIN": 1000,
    "RC2_REV": 1,
    "RC2_TRIM": 1500,
    "RC3_DZ": 10,
    "RC3_MAX": 2000,
    "RC3_MIN": 1000,
    "RC3_REV": 1,
    "RC3_TRIM": 1500,
    "RC4_DZ": 10,
    "RC4_MAX": 2000,
    "RC4_MIN": 1000,
    "RC4_REV": 1,
    "RC4_TRIM": 1500,
    "RC5_DZ": 10,
    "RC5_MAX": 2000,
    "RC5_MIN": 1000,
    "RC5_REV": 1,
    "RC5_TRIM": 1500,
    "RC6_DZ": 10,
    "RC6_MAX": 2000,
    "RC6_MIN": 1000,
    "RC6_REV": 1,
    "RC6_TRIM": 1500,
    "RC7_DZ": 10,
    "RC7_MAX": 2000,
    "RC7_MIN": 1000,
    "RC7_REV": 1,
    "RC7_TRIM": 1500,
    "RC8_DZ": 10,
    "RC8_MAX": 2000,
    "RC8_MIN": 1000,
    "RC8_REV": 1,
    "RC8_TRIM": 1500,
    "RC9_DZ": 0,
    "RC9_MAX": 2000,
    "RC9_MIN": 1000,
    "RC9_REV": 1,
    "RC9_TRIM": 1500,
    "RC_ACRO_TH": 0.5,
    "RC_ASSIST_TH": 0.25,
    "RC_AUTO_TH": 0.75,
    "RC_CHAN_CNT": 0,
    "RC_FAILS_THR": 0,
    "RC_KILLSWITCH_TH": 0.25,
    "RC_LOITER_TH": 0.5,
    "RC_MAP_ACRO_SW": 0,
    "RC_MAP_AUX1": 0,
    "RC_MAP_AUX2": 0,
    "RC_MAP_AUX3": 0,
    "RC_MAP_AUX4": 0,
    "RC_MAP_AUX5": 0,
    "RC_MAP_FAILSAFE": 0,
    "RC_MAP_FLAPS": 0,
    "RC_MAP_FLTMODE": 0,
    "RC_MAP_KILL_SW": 0,
    "RC_MAP_LOITER_SW": 0,
    "RC_MAP_MODE_SW": 0,
    "RC_MAP_OFFB_SW": 0,
    "RC_MAP_PARAM1": 0,
    "RC_MAP_PARAM2": 0,
    "RC_MAP_PARAM3": 0,
    "RC_MAP_PITCH": 0,
    "RC_MAP_POSCTL_SW": 0,
    "RC_MAP_RATT_SW": 0,
    "RC_MAP_RETURN_SW": 0,
    "RC_MAP_ROLL": 0,
    "RC_MAP_THROTTLE": 0,
    "RC_MAP_TRANS_SW": 0,
    "RC_MAP_YAW": 0,
    "RC_OFFB_TH": 0.5,
    "RC_POSCTL_TH": 0.5,
    "RC_RATT_TH": 0.5,
    "RC_RETURN_TH": 0.5,
    "RC_TH_USER": 0,
    "RC_TRANS_TH": 0.25,
    "RTL_DESCEND_ALT": 10,
    "RTL_LAND_DELAY": 0,
    "RTL_MIN_DIST": 0.5,
    "RTL_RETURN_ALT": 30,
    "SDLOG_EXT": 0,
    "SDLOG_GPSTIME": 0,
    "SDLOG_PRIO_BOOST": 0,
    "SDLOG_RATE": 0,
    "SDLOG_UTC_OFFSET": 0,
    "SENS_BARO_QNH": 1013.25,
    "SENS_BOARD_ROT": 0.00000,
    "SENS_BOARD_X_OFF": 0.000001,
    "SENS_BOARD_Y_OFF": 0,
    "SENS_BOARD_Z_OFF": 0,
    "SENS_DPRES_ANSC": 0,
    "SENS_DPRES_OFF": 0,
    "SYS_AUTOCONFIG": 0,
    "SYS_AUTOSTART": 0.0000000,
    "SYS_MC_EST_GROUP": 0,
    "SYS_PARAM_VER": 0,
    "SYS_RESTART_TYPE": 0,
    "VT_NAV_FORCE_VT": 0,
    "VT_OPT_RECOV_EN": 0,
    "VT_TYPE": 0,
    "VT_WV_LND_EN": 0,
    "VT_WV_LTR_EN": 0,
    "VT_WV_YAWR_SCL": 0.15,
    "_HASH_CHECK": -125433245000000000000
  },
  "total": 399
}
 

Description

Lists all params. “Current” represents the current number of loaded parameters. “Total” is the total number of params the drone contains. “Missing” is an array of indexes that the API could not load. You may request these manually by using the GET /param request, or by using the params/refresh request to manually reload all of the params.

 
gethttp://cloud.dronesmith.io/api/drone/name|id/params/refresh
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Refresh drone parameters
response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/params/refresh', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Status": "OK",
  "total": 0
}
 

Description

Force API to get all params again. Useful if params were changed externally. You will need to use GET /params to see the updated list.

Suggest Edits

/param/{param_name|index}

 
gethttp://cloud.dronesmith.io/api/drone/name|id/param/param_name|index
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Get RC2_TRIM paramater value
response = requests.get('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/param/RC2_TRIM', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

1500
{
  "error": "Param not found."
}

Path Params

param_name|index
string
required

The name of the param, such as “ATT_EXT_HDG_M” or the index number, from 1 to the total param number.

 

Description

Get a single param value.

Suggest Edits

/param/{param_name|index}

 
posthttp://cloud.dronesmith.io/api/drone/name|id/param/param_name|index
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'prickly_galileo'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Set RC2_TRIM parameter value
response = requests.post('http://api.dronesmith.io/api/drone/'+ DRONE_NAME + '/param/RC2_TRIM', json={

	"value": 1525 
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Status": "OK"
}
{
  "error": "Param not found."
}

Path Params

param_name|index
string
required

The name of the param, such as “ATT_EXT_HDG_M” or the index number, from 1 to the total param number.

Body Params

value
mixed type

The new value to change the parameter to. Always a number. Required.

 

Description

Updates the value of a param.

Suggest Edits

Command & Control

 

The command and control aspect of the API is used to remotely control your drone through the cloud. All requests are POST requests, and follow the standard drone/id convention.

Command Acknowledgement

With the exception of the /input command, all command and control messages return a command ACK response, such as the following:

{
	“Command”: <command number>,
	“Status”: <description of the command result>,
  "StatusCode": <value, see below>
}

Command is the MAVLink number of the vehicle command. Status is the string that provides information about how the command was handled. It will usually be accepted, but could be rejected or was simply not received by the drone.

Status Codes

0: Command was accepted successfully.
1: Command was denied/rejected, this mean it could not execute the command, usually because the drone is already doing the command.
2: Command was permanently denied. This means the drone must be reconfigured in order to use this command, and cannot be in flight. (See params API for configuration).
3: Command unsupported. This means the command was recognized but is not supported by the internal firmware.
4: Command failed. There was an internal error with the drone firmware itself.
10: Command unknown. Means that the API could not retrieve the status of the command.

posthttp://cloud.dronesmith.io/api/drone/name|id/arm
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/arm', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Command": 176,
  "Status": "Command accepted.",
  "StatusCode": 0
}
{
  "error": "Drone not online."
}
 

Description

Attempts to arm the drone, allowing the motors to run. GET /motors can be used to see the raw signal value of the motors.

 
posthttp://cloud.dronesmith.io/api/drone/name|id/disarm
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/disarm', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Command": 176,
  "Status": "Command accepted."
}
{
  "error": "Drone not online."
}
 

Description

Attempts to disarm the drone, disallowing the motors to run.

posthttp://cloud.dronesmith.io/api/drone/name|id/mode
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Command drone to go into RTL (Return to Launch) mode
response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/mode', json={
    
    "mode":"RTL"
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Command": 176,
  "Status": "Command accepted.",
  "StatusCode": 0
}
{
  "error": "Drone not online."
}

Body Params

mode
string

A string with the drone mode to change to. Optional. If not included, the mode will not be changed. See GET /mode for a list of valid modes

armed
boolean

A boolean to arm the drone or not. Optional. If not included, the arming state of the drone will not be changed.

 

Description

Change the drone’s control mode and arm or disarm it, such as Manual, Position, RTL, or Auto. Please note the mode value is case sensitive. If mode field is blank, the drone will not attempt to change mode. “arm” may be set to true or false, or left blank. If blank, it will not attempt to change the drone’s arming state.

 
posthttp://cloud.dronesmith.io/api/drone/name|id/takeoff
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Command drone to takeoff and hover 20 meters above Lat: 47.399091, Lon: 8.549200
response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/takeoff', json={
    
    "lat": 47.399091,
    "lon": 8.549200,
    "altitude": 20
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Command drone to takeoff and hover at 518 meters MSL
response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/takeoff', json={
    "relativeAlt": False,
    "altitude": 518
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "bytes"
  "time"

)

var endpoint = "http://api.dronesmith.io/api/" 

func main() {

  client := &http.Client{
    Timeout: 3 * time.Second,
  }

  var url bytes.Buffer
  url.WriteString(endpoint)
  url.WriteString("drone/zen_goodall/takeoff")
 
  var jsonStr = []byte(`{"altitude": 20}`)

  req, err := http.NewRequest("POST", url.String(), bytes.NewBuffer(jsonStr))
  if err != nil {

  }
  req.Header.Set("Content-Type", "application/json")
  req.Header.Set("user-email", "example@example.com")
  req.Header.Set("user-key", "example-api-key")

  resp, err := client.Do(req)

  body, err := ioutil.ReadAll(resp.Body)
  defer resp.Body.Close()
  
  fmt.Printf("%s\n", body)

}
A binary file was returned

You couldn't be authenticated

{
  "Command": 22,
  "Status": "Command accepted.",
  "StatusCode": 0
}
{
  "error": "Drone not online."
}

Body Params

relativeAlt
boolean

true for relative coordinate frame for altitude, false for MSL (mean sea level) altitude. This field is true by default.

relativePos
boolean

true for relative coordinate frame for GPS position, false for absolutely GPS coordinates. This field is false by default.

lat
float

the input latitude to takeoff and hold position at. Optional. If not included, holds at its present latitude.

lon
float

the input longitude to takeoff and hold position at. Optional. If not included holds at its present longitude.

altitude
float

the relative altitude to takeoff and hold at. Optional. If not included, defaults to 10 meters.

 

Description

Tells the drone to take off and hold at a certain altitude and/or location, if specified in the request body. A GPS unit is required.

posthttp://cloud.dronesmith.io/api/drone/name|id/land
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

# Command drone to land
response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/land', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Command": 21,
  "Status": "Command accepted.",
  "StatusCode": 0
}
{
  "error": "Drone not online."
}
 

Description

Tells the drone to land at its current location. Land by extension also forces the drone into a failsafe mode if there are any issues with performing a controlled descent.

posthttp://cloud.dronesmith.io/api/drone/name|id/goto
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

#Command drone to go to Lat: 47.398670, Lon: 8.551243
response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/goto', json={
    
    "lat": 47.398670, 
    "lon": 8.551243
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Command": 192,
  "Status": "Command accepted.",
  "StatusCode": 0
}
{
  "error": "Drone not online."
}

Body Params

relativeAlt
boolean

true for relative coordinate frame for altitude, false for MSL (mean seal level) altitude. This field is true by default.

relativePos
boolean

true for relative coordinate frame for GPS position. False for absolutely GPS coordinates. This field is false by default.

lat
string

the relative input latitude to go to and hold position at. Optional. If not included, holds at its present latitude.

lon
string

the relative input longitude to go to and hold position at. Optional. If not included holds at its present longitude.

altitude
float

the altitude to go to and hold at. Optional. If not included, defaults to present altitude.

speed
float

How fast in meters/second to travel. Default is 5.

heading
float

Indicate what heading to hold from 0 359. Default value is the direction of the drone's flight path.

 

Description

Instructs the drone to fly to a specific location. If no location is specified, it will simply hold its current position. A GPS unit is required. The drone must be in the air to use.

posthttp://cloud.dronesmith.io/api/drone/name|id/home
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

#Command drone to go to Lat: 47.398670, Lon: 8.551243
response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/home', json={
    
    "lat": 47.398670, 
    "lon": 8.551243
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Command": 179,
  "Status": "Command accepted.",
  "StatusCode": 0
}
{
  "error": "Drone not online."
}

Body Params

lat
string

The relative input latitude for home. If not included, defaults to current home latitude.

lon
string

The relative input longitude for home. If not included, defaults to current home longitude

 

Description

Update your drone’s home location.

posthttp://cloud.dronesmith.io/api/drone/name|id/input
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

#Set radio channel values
response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/input', json={
    
	"type": "radio",
	"enabled": True,
	"channels": [1500, 1500, 1750, 1500]
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Status": "OK"
}
{
  "error": "Drone not online."
}

Body Params

type
string

Required. Currently must be set to “radio.”

enabled
string

Set to true to allow manual input updates to the drone. Set to false to stop them.

timeout
string

Number of milliseconds to specify for the API to disable manual input if no new POST /input is received in this time frame. Optional. If not specified, the API will never timeout.

channels
array of integers

The input values for each radio channel. Range is from 1000 to 2000 on virtual drones.

 

Description

Programmatically control your drone’s movements.

Channels are arranged as an array, where the first index represents the first channel. For a virtual drone, the mapping is default as follows:

Channel 1: Roll (1000 - 2000, 1500 is no roll)
Channel 2: Pitch (1000 - 2000, 1500 is no pitch)
Channel 3: Throttle (1000 - 2000, 1750 is enough throttle to hold the drone at its present altitude)
Channel 4: Yaw (1000 - 2000, 1500 is no yaw)

Suggest Edits

/command

Send a generic MAVLink command.

 
posthttp://cloud.dronesmith.io/api/drone/name|id/command
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

#Send MAVLink command
response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/command', json={
    
	"command": 176,
	"args": [29, 4, 2]
    
}, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "Command": 176,
  "Status": "Command accepted.",
  "StatusCode": 0
}
{
  "error": "Drone not online."
}

Body Params

command
string

the MAVLink command number. Required.

args
array of integers

From 1 to 7, each argument. Depends on the command type. Optional.

 

Description

Send a generic MAVLink command to your drone.

 
gethttp://cloud.dronesmith.io/api/mission
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/mission?size=3&page=2&sort=start', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "missions": [
    {
      "__v": 0,
      "_id": "58192492a695f831795a9beb",
      "created": "2016-11-01T23:26:10.392Z",
      "end": "2016-11-02T02:18:04.401Z",
      "kind": "mavlinkBinary",
      "name": "",
      "start": "2016-11-02T02:16:38.307Z",
      "user": null
    },
    {
      "__v": 0,
      "_id": "581924ed260dce317023bfc6",
      "created": "2016-11-01T23:27:41.396Z",
      "end": "2016-11-02T02:21:13.418Z",
      "kind": "mavlinkBinary",
      "name": "",
      "start": "2016-11-02T02:21:11.380Z",
      "user": null
    },
    {
      "__v": 0,
      "_id": "581ba34d6741f031cf618b5c",
      "created": "2016-11-03T20:51:25.098Z",
      "end": "2016-11-03T20:54:56.128Z",
      "kind": "mavlinkBinary",
      "name": "",
      "start": "2016-11-03T20:52:01.951Z",
      "user": null
    }
  ],
  "page": 2,
  "size": 3,
  "total": 85
}
  

Query Params

size
int32

The number of missions to include in the object. Default is 10 if no size is specified.

page
int32

The offset to return. Only applicable if size has been set. For instance, a size of 10 with a page of 2 would return missions starting from 10 * (2-1) = 10 to 20.

sort
string

Order the missions by a field. Use a dash - (minus) to specify an inverted ordering.

 

Description

Get all missions associated with a user. You may use query strings to change the amount to fetch at once, or which page. Please note this query does not grab raw recorded data. You must GET /api/mission/<mission_id> in order to get detailed data.

Returned Fields

total - total number of missions
size - Number of returned missions
page - the specified page. Null if page is not applicable.
missions - The mission object.

Suggest Edits

/mission/{mission_id}

 
gethttp://cloud.dronesmith.io/api/mission/mission_id
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/mission/581251be8f775cb114e3834a', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "_id": "581251be8f775cb114e3834a",
  "kind": "mavlinkBinary",
  "start": "2016-10-27T19:15:13.985Z",
  "end": "2016-10-27T19:20:06.214Z",
  "user": null,
  "flight": [
    {
      "message": 30,
      "payload": {
        "time_boot_ms": 132001,
        "roll": -0.006278814747929573,
        "pitch": 0.032164089381694794,
        "yaw": 0.01402966771274805,
        "rollspeed": -0.022026557475328445,
        "pitchspeed": -0.08455482125282288,
        "yawspeed": -0.05751141905784607
      },
      "componentId": 1,
      "systemId": 1,
      "time": "2016-10-27T19:15:13.985Z"
    },
	
   ]
}
 

Description

Get a single mission and its internal flight data.

Returned Fields

_id - the mission Id. A unique ID for each mission object.
kind - The type of format. 3 formats are supported:
       Mavlink - MAVLink in JSON format.
       mavlinkBinary - MAVLink in binary format.
start - the start time of the flight.
end - the end time of the flight.
user - an associated user id with the mission.
flight - An array of messages that were recorded during the flight. Each message represents a MAVLink message.

Message Fields

message - the number of the MAVLink message
payload - the data fields in the MAVLink message
componentId - component Id of MAVLink message
systemId - system Id of MAVLink message
time- timestamp of MAVLink message

Suggest Edits

/mission/{mission_id}

 
deletehttp://cloud.dronesmith.io/api/mission/mission_id
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.delete('http://api.dronesmith.io/api/mission/581bd3e5f66a2c31fc16255a', headers=headers)
jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "status": "OK",
  "missionRef": false
}
 

Description

Removes a mission object from the cloud, and deassociates the mission from the drone.

Suggest Edits

Directly Access a Drone

 

For more advanced users, one may want to directly access their drone’s Linux environment. Our API provides two requests for doing this. Note that this API is currently not supported on simulated drones due to container access issues.

Suggest Edits

/ssh/open

 
posthttp://cloud.dronesmith.io/api/drone/name|id/ssh/open
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/ssh/open', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "info": {
    "port": 16229,
    "url": "0.tcp.ngrok.io"
  },
  "status": "OK"
}
 

Description

Creates an SSH connection with the drone in question. The username and password are the same as the ones you used to set the drone up.

Suggest Edits

/ssh/close

 
posthttp://cloud.dronesmith.io/api/drone/name|id/ssh/close
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/ssh/close', headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

{
  "status": "OK"
}
 

Description

Closes an SSH connection to the drone.

Suggest Edits

User Defined Sensors/Payloads

 

One of the biggest applications of drones is being able to gather and collect data for specialized application in areas that are dirty, dangerous, or dull. The Sensor API can help you achieve this by providing access points to our API.

Suggest Edits

/sensor/{sensor_name}

 
posthttp://cloud.dronesmith.io/api/drone/name|id/sensor/sensor_name
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'
SENSOR_NAME     = 'gas_sensor'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.post('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/sensor/' + SENSOR_NAME, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

No response examples available
 

Description

Allows you to upload user defined sensor data to your drone, specified by name. Uploading new sensor data overrides the old data. The body of the request contains the data you wish to upload. This data is completely generic and allows you to upload whatever you want. This request can be called by DS Link, or by any app using this API.

Suggest Edits

/sensor/{sensor_name}

 
gethttp://cloud.dronesmith.io/api/drone/name|id/sensor/sensor_name
import json
import requests

USER_EMAIL      = 'example@example.com'
USER_API_KEY    = 'example-api-key'
DRONE_NAME      = 'zen_goodall'
SENSOR_NAME     = 'gas_sensor'

headers = {
    'user-email':       USER_EMAIL,
    'user-key':         USER_API_KEY,
    'Content-Type':     'application/json'
}

response = requests.get('http://api.dronesmith.io/api/drone/' + DRONE_NAME + '/sensor/' + SENSOR_NAME, headers=headers)

jsonText = json.loads(response.text)
print json.dumps(jsonText, indent=2, sort_keys=True)
A binary file was returned

You couldn't be authenticated

No response examples available
 

Description

Returns user defined sensor information. To get all sensors, simply request the drone object.