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//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/
- 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.