NAV Navbar
shell ruby python javascript
  • Introduction
  • Getting Started
  • Authentication
  • Planning and Records API
  • Fleet API
  • Live Flight API
  • Airspace API
  • Introduction

    Garuda Robotics provides a suite of APIs that extend the Garuda Plex Platform, allowing you to create your own proprietary applications to address a variety of drone use cases. The APIs are available for the entire lifecycle of drone operations, from pre-flight planning, to live flights, to post-flight analytics.

    Getting Started

    To get started, you will require 2 items:

    1. An API Key
    2. A Garuda Plex Account

    Please speak to your account manager to request for an API Key. If you do not have an account manager or if you are an individual developer, please register your interest here.

    To sign up for a Garuda Plex account, head down to the Garuda Plex sign up page and complete the sign up process.

    Garuda Plex API Key

    This API Key must be kept secret. Exposing your API Key publicly can result in your account being compromised. By using the API Key to access your Garuda Plex account, you are subjected to same terms of use of Garuda Plex.

    Some best practices to keep your API Key secure:

    Authentication

    APIs that involve interacting with your organization's data, such as pilots and drones, requires authentication. Other APIs such as weather and airspace data only require your API Key.

    For authentication, Garuda Plex uses the OpenID Connect (OIDC) implicit flow. Here's how you can add Garuda Plex authentication to your own application:

    oidc_flow

    (1) Your application directs the user to Garuda Plex Identity Service URL with the required query parameters to allow the user to login to Garuda Plex. Refer to the right for an example. The required parameters are as follows:

    URL Template (contains whitespace for readability):

    https://<URL>?
      client_id=<CLIENT_ID>&
      redirect_url=<REDIRECT_URL>&
      response_type=<RESPONSE_TYPES>&
      scope=<SCOPES>&
      nonce=<NONCE>
    

    Example URL:

    https://identity.stg.garuda.io/auth?
      client_id=de5dee51-ded8-43b3-a51d-476545039ecb&
      redirect_uri=https%3A%2F%2Fyour-website%2Fcallback&
      response_type=id_token%20token&
      scope=openid%20email&
      nonce=cf6a9372cad19c4809a325167a519230
    
    Parameter Description
    client_id The client ID that is provided to you when you register as a developer (provided along with API Key)
    redirect_uri Page to return to after successful login. Has to be URL encoded.
    response_type OpenID response type. This will be provided to you when you register as a developer.
    scope OpenID scope. The following are supported: openid, offline_access, email, profile, address, plex
    nonce A case sensitive string value used to associate a Client session with an ID Token, and to mitigate replay attacks. nonce will be returned to the client together with the authorization token.Use the nonce to validate the token received against the initial authorization request

    (2) Garuda Plex Identity Service will validate your user's credentials.

    Example redirect URL:

    https://your-website/callback?
      id_token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InNpZy1ycy0wIn&
      access_token=eyJ0eXAiOiJKV1QiR5kpXVCIscCI6ILCJhbGciOiJSUzI6InI1NiIsImtpZC&
      expires_in=3600&
      token_type=Bearer&
      session_state=bfefcc5422b376ec61650c6b165f0d758f9a4b741460c72
    

    (3) If validation is successful, the user will be redirected back to your application via the redirect_uri, with the requested tokens attached in the query string of the URL. Use the access_token attached to make authenticated calls to Garuda Plex Platform. (Note: Tokens have been shortened for brevity)

    Planning and Records API

    The Planning and Records APIs allows you to manage projects, deployments, flight plans and flight sessions.

    Projects

    All activities on Garuda Plex start with a project being specified. It’s a unit of engagement for the Drone Operator and the Customer, whoever it may be. Real world projects include, a flight test project, a mapping project, a 3D modelling project, an infrastructure inspection project, or an elaborate flight demonstration project.

    The Customer, or its agent (such as the Sales Person or the Project Manager), is responsible to create a project. If you’re writing workflow applications, you can collect the requirements in your application and create a project programmatically through the API, and the Drone Operator would be able to plan deployment and flights using Garuda Plex web front-end. You can connect Garuda Plex to your billing or invoicing infrastructure to receive a status update about the completion of the project.

    On the other hand, if you are working to extend the operational workflow or flight capabilities for the Drone Operator, you can read the requirements from the planned project, and make sure that you carry it out according to requirements, and update the project as work is completed.

    A project has the following properties:

    Property Type Description
    _id String The unique ID of the project (use this for updating and deleting the project)
    title String Title of the project
    project_id String Unique URL-friendly ID (Slug) of the project
    company_id String Company ID of the project
    date String Start date of the project
    objective String Objective of the project
    description String Description of the project
    location String Name of the location of the project

    Get all projects

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/projects',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/projects', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/projects' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/projects',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "_id": "2b6d1671011c488c6583f07824fbf2c1",
          "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
          "title": "PROJECT-001",
          "date": 1562559123000,
          "project_id": "project-1",
          "public": {
            "id": "project-1"
          },
          "last_update": {
            "user_id": "3b20c067ab91da9436ddaea6b83a9536",
            "name": "USER-001",
            "time": 1562560345456
          }
        }
      ]
    }
    

    GET /projects

    Get all the projects belonging to your company. This endpoint returns you all the projects that have been created under you company.

    The response body for this endpoint will contain an array of all the project objects.

    Create new project

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/projects',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/projects', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/projects' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "title": "PROJECT-001",
          "date": 1562559123000
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "title": "PROJECT-001",
      "date": 1562559123000
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/projects',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "_id": "2b6d1671011c488c6583f07824fbf2c1",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "title": "PROJECT-001",
        "date": 1562559123000,
        "project_id": "project-1",
        "public": {
          "id": "project-1"
        },
        "last_update": {
          "user_id": "3b20c067ab91da9436ddaea6b83a9536",
          "name": "USER-001",
          "time": 1562560345456
        }
      }
    }
    

    POST /projects

    This endpoint allows you to create a new project under your company.

    You should pass in at minimum the following details in the request body:

    Item Type Description
    title String A valid deployment ID belonging to your company
    date Number A valid and approved flight plan ID

    To further flesh out the details of a project, you can pass in the following properties as well:

    Item Type Description
    objective String Short description of the objectives of the project
    description String Description of the project
    location String Location of the project

    Get a project

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/projects/{project_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/projects/{project_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/projects/{project_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/projects/{project_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "_id": "2b6d1671011c488c6583f07824fbf2c1",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "title": "PROJECT-001",
        "date": 1562559123000,
        "project_id": "project-1",
        "public": {
          "id": "project-1"
        },
        "last_update": {
          "user_id": "3b20c067ab91da9436ddaea6b83a9536",
          "name": "USER-001",
          "time": 1562560345456
        }
      }
    }
    

    GET /projects/{project_id}

    Get a specific project belonging to the company of the user.

    Update a project

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/projects/{project_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/projects/{project_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/projects/{project_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
           "title": "PROJECT-001-A"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "title": "PROJECT-001-A"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/projects/{project_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "_id": "2b6d1671011c488c6583f07824fbf2c1",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "title": "PROJECT-001-A",
        "date": 1562559123000,
        "project_id": "project-1",
        "public": {
          "id": "project-1"
        },
        "last_update": {
          "user_id": "3b20c067ab91da9436ddaea6b83a9536",
          "name": "USER-001",
          "time": 1562560345456
        }
      }
    }
    

    PATCH /projects/{project_id}

    Update a specific project belonging to the company of the user.

    To update a project, you can pass in any subset of the properties of the project in the request body. All properties are optional.

    Property Type Description
    title String Title of the project
    date String Starting date of the project
    objective String Short description of the objectives of the project
    description String Description of the project
    location String Location of the project

    A project that has been successfully updated will return a response with a "success": true body and a 200 OK status.

    Delete a project

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/projects/{project_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/projects/{project_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/projects/{project_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/projects/{project_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "_id": "2b6d1671011c488c6583f07824fbf2c1",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "title": "PROJECT-001-A",
        "date": 1562559123000,
        "project_id": "project-1",
        "public": {
          "id": "project-1"
        },
        "last_update": {
          "user_id": "3b20c067ab91da9436ddaea6b83a9536",
          "name": "USER-001",
          "time": 1562560345456
        },
        "deleted": true
      }
    }
    

    DELETE /projects/{project_id}

    Delete a specific project belonging to the company of the user.

    A successful deletion will return a 200 OK status and the deleted project object in the response body.

    Deployments

    Every time pilots are activated to fly drones, it is known as a deployment. A deployment is part of larger project, typically spans at least 1 flight session (or maybe a few minutes to a few hours), or multiple flight sessions. For each deployment, a leader, known as the deployment lead will plan the deployment for success, enlisting pilots, drones, and other equipment necessary. Proper risk management is required for every deployment, as are permits by the relevant authority (such as an Activity Permit by CAAS). Insurance coverage might also be purchased on a deployment basis instead of annual basis.

    A full deployment object, including all optional properties

    {
      "name": "DEPLOYMENT-001",
      "deployment_id": "9703889c2bb4322025815ed1a0509eba",
      "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
      "project_id": "2b6d1671011c488c6583f07824fbf2c1",
      "purpose": [
        "Delivery, Discharge"
      ],
      "deployment_lead": {
        "name": "USER-001",
        "user_id": "3b20c067ab91da9436ddaea6b83a9536"
      },
      "personnel": [
        {
          "name": "USER-002",
          "user_id": "53494af9b7e38f5df3447d17fe0b7547"
        }
      ],
      "drones": [
        {
          "name": "DRONE-001",
          "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
          "model_name": "M400 UAV",
          "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
        }
      ],
      "batteries": [
        {
          "name": "BATTERY-001",
          "battery_id": "f42074ff0948fbb1d11f7a96c07cdcdd",
          "model_name": "Multistar 6S 6600",
          "model_id": "4b38b7383fdb23fbff8c3a6a694e4533"
        }
      ],
      "cameras": [
        {
          "name": "CAMERA-001",
          "camera_id": "0b53479856488f542a18fef96b84119d",
          "model_name": "Powershot S100",
          "model_id": "0e51493cd1ae85c097547de808642659"
        }
      ],
      "payloads": [
        "Small Box"
      ],
      "checklist": [
        {
          "name": "DRONE-001",
          "type": "Equipment",
          "checked": false
        },
        {
          "name": "BATTERY-001",
          "type": "Equipment",
          "checked": false
        },
        {
          "name": "CAMERA-001",
          "type": "Equipment",
          "checked": false
        }
      ],
      "targets": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    103.78140449523926,
                    1.292500533024804
                  ],
                  [
                    103.78011703491211,
                    1.2929295772415663
                  ],
                  [
                    103.78028869628905,
                    1.2908701643402538
                  ],
                  [
                    103.78286361694336,
                    1.2922431064599564
                  ],
                  [
                    103.78140449523926,
                    1.292500533024804
                  ]
                ]
              ]
            }
          }
        ]
      },
      "start_date": 1559571926000,
      "end_date": 1559572026000,
      "status": "new",
      "create_date": 1562216203843,
      "last_modified_date": 1562216203843,
      "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536"
    }
    

    Each deployment object will have the following properties:

    Property Type Description
    name String Name of the deployment
    deployment_id String Unique deployment ID
    company_id String Unique company ID
    project_id String Unique project ID
    purpose Array Array of enumerated strings describing the purpose of the deployment. Refer to the table below for the valid enums
    deployment_lead Object User object representing the deployment lead
    personnel Array Array of user objects representing the personnel involved in the deployment
    drones Array Array of drone objects tagged to the deployment
    batteries Array Array of battery objects tagged to the deployment
    cameras Array Array of camera objects tagged to the deployment
    payloads Array Array of strings, each describing a payload tagged to the deployment
    checklist Array Array of objects, each describing a an equipment (drone, battery or camera) that is registered to the deployment, or a custom object that is also needed for the deployment.
    targets Object GeoJSON FeatureCollection that represents the deployment targets.
    start_date Number Start date of deployment in epoch (Unix timestamp), converted to milliseconds (ms)
    end_date Number End date of deployment in epoch (Unix timestamp), converted to milliseconds (ms)
    status String Enumerated string describing the status of the deployment. See below for the list of enums.
    create_date Number Date of creation of the deployment in epoch (Unix timestamp), converted to milliseconds (ms).
    last_modified_date Number Last modified date of the deployment in epoch (Unix timestamp), converted to milliseconds (ms).
    last_modified_by String User ID of the last user that modified this deployment.

    The property purpose in a each deployment is represented by a set of enumerations. When creating a new deployment, you should specify one or more of the following purposes as an array of strings:

    Purpose
    Aerial Photography, Demonstration, Inspection (Building, Facility), Surveillance (Security), First Response, Recreational, Internal Training, Research & Development, Aerial Videography, Training (Academy), Survey (Land, Plantation), Delivery, Discharge

    The property status represents the status of deployment, and can be one of the following 4 enums:

    Status
    new, draft, pending, ready to fly, cancelled

    Get all deployments

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/deployments',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/deployments', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/deployments' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/deployments',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    

    Successful call returns a 200 OK response:

    {
      "success": true,
      "data": [
        {
          "name": "DEPLOYMENT-001",
          "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
          "deployment_id": "9703889c2bb4322025815ed1a0509eba",
          "project_id": "2b6d1671011c488c6583f07824fbf2c1",
          "deployment_lead": {
            "name": "USER-001",
            "user_id": "3b20c067ab91da9436ddaea6b83a9536"
          },
          "drones": [
            {
              "name": "DRONE-001",
              "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
              "model_name": "M400 UAV",
              "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
            }
          ],
          "checklist": [
            {
              "name": "DRONE-001",
              "type": "Equipment",
              "checked": false
            }
          ],
          "purpose": [
            "Aerial Photography"
          ],
          "start_date": 1559571926000,
          "end_date": 1559572026000,
          "create_date": 1552216203843,
          "last_modified_date": 1552216203843,
          "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536"
        },
        {
          "name": "DEPLOYMENT-002",
          "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
          "deployment_id": "d3ad29d17ef123309de61c0d74ad595b",
          "project_id": "2b6d1671011c488c6583f07824fbf2c1",
          "drones": [
            {
              "name": "DRONE-001",
              "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
              "model_name": "M400 UAV",
              "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
            }
          ],
          "batteries": [
            {
              "name": "BATTERY-001",
              "battery_id": "f42074ff0948fbb1d11f7a96c07cdcdd",
              "model_name": "Multistar 6S 6600",
              "model_id": "4b38b7383fdb23fbff8c3a6a694e4533"
            }
          ],
          "checklist": [
            {
              "name": "DRONE-001",
              "type": "Equipment",
              "checked": false
            },
            {
              "name": "BATTERY-001",
              "type": "Equipment",
              "checked": false
            }
          ],
          "deployment_lead": {
            "name": "USER-001",
            "user_id": "3b20c067ab91da9436ddaea6b83a9536"
          },
          "purpose": [
            "Demonstration"
          ],
          "start_date": 1559571926000,
          "end_date": 1559572026000,
          "create_date": 1552216203843,
          "last_modified_date": 1552216203843,
          "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536"
        }
      ]
    }
    

    GET /deployments

    GET /deployments?project_id=<PROJECT_ID>

    Get all deployments belonging to the company of the user. Calling this endpoint will return you an array of JSON objects representing each deployment created under the company.

    You can retrieve all deployments belonging to your company via this endpoint. This endpoint also allows you to specify if you would like to filter by project via query strings.

    You can also specify the extent of which to fetch the data via query strings:

    Query Values Description
    options shallow, deep Specify if data retrieved should be a deep or shallow fetch

    For a shallow fetch (which is the default behaviour), the drones, batteries, cameras and personnel will be retrieved with only their name and id (see sample response on the left for how this will look like). A deep fetch will retrieve more information for each of the objects -- to see the exact properties that will be retrieved with a deep fetch, refer to the Fleet API.

    Create new deployment

    Code samples

    require 'rest-client'
    require 'json'
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    result = RestClient.post 'https://api.garuda.io/v2/deployments',
      params: {
      }, headers: headers
    p JSON.parse(result)
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/deployments', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/deployments' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
           "name": "DEPLOYMENT-001",
           "project_id": "2b6d1671011c488c6583f07824fbf2c1",
           "drones": [
             "082e8ea46f49d95ef08233fde6da72ac"
           ],
           "deployment_lead_id": "3b20c067ab91da9436ddaea6b83a9536",
           "purpose": [
             "Aerial Photography"
           ],
           "start_date": 1559571926000,
           "end_date": 1559572026000,
           "targets": {
             "type": "FeatureCollection",
             "features": [
               {
                 "type": "Feature",
                 "properties": {},
                 "geometry": {
                   "type": "Polygon",
                   "coordinates": [
                     [
                       [
                         103.78140449523926,
                         1.292500533024804
                       ],
                       [
                         103.78011703491211,
                         1.2929295772415663
                       ],
                       [
                         103.78028869628905,
                         1.2908701643402538
                       ],
                       [
                         103.78286361694336,
                         1.2922431064599564
                       ],
                       [
                         103.78140449523926,
                         1.292500533024804
                       ]
                     ]
                   ]
                 }
               }
             ]
           }
          }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "DEPLOYMENT-001",
      "project_id": "2b6d1671011c488c6583f07824fbf2c1",
      "drones": [
        "082e8ea46f49d95ef08233fde6da72ac"
      ],
      "deployment_lead_id": "3b20c067ab91da9436ddaea6b83a9536",
      "purpose": [
        "Aerial Photography"
      ],
      "start_date": 1559571926000,
      "end_date": 1559572026000,
      "targets": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    103.78140449523926,
                    1.292500533024804
                  ],
                  [
                    103.78011703491211,
                    1.2929295772415663
                  ],
                  [
                    103.78028869628905,
                    1.2908701643402538
                  ],
                  [
                    103.78286361694336,
                    1.2922431064599564
                  ],
                  [
                    103.78140449523926,
                    1.292500533024804
                  ]
                ]
              ]
            }
          }
        ]
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/deployments',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    Successful call returns a 200 OK response:

    {
      "name": "DEPLOYMENT-001",
      "deployment_id": "9703889c2bb4322025815ed1a0509eba",
      "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
      "project_id": "2b6d1671011c488c6583f07824fbf2c1",
      "drones": [
        {
          "name": "DRONE-001",
          "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
          "model_name": "M400 UAV",
          "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
        }
      ],
      "deployment_lead": {
        "name": "USER-001",
        "user_id": "3b20c067ab91da9436ddaea6b83a9536"
      },
      "purpose": [
        "Aerial Photography"
      ],
      "start_date": 1559571926000,
      "end_date": 1559572026000,
      "targets": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    103.78140449523926,
                    1.292500533024804
                  ],
                  [
                    103.78011703491211,
                    1.2929295772415663
                  ],
                  [
                    103.78028869628905,
                    1.2908701643402538
                  ],
                  [
                    103.78286361694336,
                    1.2922431064599564
                  ],
                  [
                    103.78140449523926,
                    1.292500533024804
                  ]
                ]
              ]
            }
          }
        ]
      },
      "create_date": 1562216203843,
      "last_modified_date": 1562216203843,
      "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536"
    }
    

    POST /deployments

    Create a new deployment belonging to the company of the user. At minimum, you should pass in the following details in the request body:

    Property Type Description
    name String Name of the deployment
    project_id String Project that this deployment belongs to
    start_date String Start date of deployment in epoch (Unix timestamp), converted to milliseconds (ms)
    end_date String End date of deployment in epoch (Unix timestamp), converted to milliseconds (ms)

    There are some additional details that you can add to the request body to flesh out your deployment details even further:

    Property Type Description
    deployment_lead_id String User ID of the deployment lead
    purpose Array Array of enumerated strings of purposes of deployment.
    drones Array Array of drone IDs to be used for the deployment
    batteries Array Array of battery IDs to be used for the deployment
    cameras Array Array of camera IDs to be used for the deployment
    payloads Array Array of strings, each describing a payload used for the deployment
    personnel Array Array of user IDs of the personnel involved in the deployment
    targets Object GeoJSON FeatureCollection of the deployment targets.
    status String Enumerated strings describing the status of the deployment.
    checklist Array Array of objects, each describing a an equipment (drone, battery or camera) that is registered to the deployment, or a custom object that is also needed for the deployment.

    If no deployment_lead_id was provided, the deployment lead will be defaulted to the user that created the deployment. The checklist will automatically add the drones, batteries and cameras that are defined in the deployment.

    Instead of only passing in IDs, we can support passing in entire objects as well (i.e. entire drone objects, entire camera objects, etc.). Passing in the entire object will automatically create the drone for the user in the backend in addition to creating the deployment as well. This is NOT supported as of now.

    A deployment that has been successfully created will return a response with a "success": true body and a 200 OK status. The response body will also return the actual deployment object that was created.

    Get a deployment

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/deployments/{deployment_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/deployments/{deployment_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/deployments/{deployment_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/deployments/{deployment_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "name": "DEPLOYMENT-001",
      "deployment_id": "9703889c2bb4322025815ed1a0509eba",
      "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
      "project_id": "2b6d1671011c488c6583f07824fbf2c1",
      "drones": [
        {
          "name": "DRONE-001",
          "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
          "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
          "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79",
          "model": {
            "name": "M400 UAV",
            "provider_id": "0c5c21b6a42fadb018a5d1863c34b35d",
            "category": "Quadcopter",
            "avatar": "",
            "compatibility": {
              "batteries": [
                "0c5c21b6a42fadb018a5d1863c37bb31",
                "0c5c21b6a42fadb018a5d1863c36abd6"
              ],
              "cameras": [
                "0c5c21b6a42fadb018a5d1863c35dc93",
                "0c5c21b6a42fadb018a5d1863c35fea4"
              ],
              "payloads": []
            },
            "weight_kg": "2.100",
            "properties": {
              "dimensions": {
                "width": "0.82",
                "length": "0.82",
                "height": "0.28"
              },
              "max_flight_time": "25",
              "rc_frequency": "2.400 - 2.483GHz"
            },
            "provider": {
              "name": "Garuda Robotics Pte Ltd",
              "brand": "Garuda",
              "company_logo": "",
              "country": "Singapore",
              "id": "0c5c21b6a42fadb018a5d1863c34b35d"
            }
          },
          "notes": "Industrial-grade quadrotor UAV suitable for a variety of applications.",
          "shared": false,
          "serviceable": true,
          "aquired_on": 1532103688243
        }
      ],
      "deployment_lead": {
        "name": "USER-001",
        "user_id": "3b20c067ab91da9436ddaea6b83a9536"
      },
      "purpose": [
        "Aerial Photography"
      ],
      "start_date": 1559571926000,
      "end_date": 1559572026000,
      "targets": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    103.78140449523926,
                    1.292500533024804
                  ],
                  [
                    103.78011703491211,
                    1.2929295772415663
                  ],
                  [
                    103.78028869628905,
                    1.2908701643402538
                  ],
                  [
                    103.78286361694336,
                    1.2922431064599564
                  ],
                  [
                    103.78140449523926,
                    1.292500533024804
                  ]
                ]
              ]
            }
          }
        ]
      },
      "create_date": 1562216203843,
      "last_modified_date": 1562216203843,
      "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536"
    }
    

    GET /deployments/{deployment_id}

    Get a specific deployment belonging to the company of the user. A valid deployment_id in the path parameter is required for a successful call.

    The deployment object returned will be the complete deployment object (i.e. deep fetch).

    Update a deployment

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/deployments/{deployment_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/deployments/{deployment_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/deployments/{deployment_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
           "purpose": [
             "Demonstration",
             "Training (Academy)"
           ]
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "purpose": [
        "Demonstration",
        "Training (Academy)"
      ]
    }';
    
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/deployments/{deployment_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "name": "DEPLOYMENT-001",
      "deployment_id": "9703889c2bb4322025815ed1a0509eba",
      "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
      "project_id": "2b6d1671011c488c6583f07824fbf2c1",
      "drones": [
        {
          "name": "DRONE-001",
          "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
          "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
          "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79",
          "model": {
            "name": "M400 UAV",
            "provider_id": "0c5c21b6a42fadb018a5d1863c34b35d",
            "category": "Quadcopter",
            "avatar": "",
            "compatibility": {
              "batteries": [
                "0c5c21b6a42fadb018a5d1863c37bb31",
                "0c5c21b6a42fadb018a5d1863c36abd6"
              ],
              "cameras": [
                "0c5c21b6a42fadb018a5d1863c35dc93",
                "0c5c21b6a42fadb018a5d1863c35fea4"
              ],
              "payloads": []
            },
            "weight_kg": "2.100",
            "properties": {
              "dimensions": {
                "width": "0.82",
                "length": "0.82",
                "height": "0.28"
              },
              "max_flight_time": "25",
              "rc_frequency": "2.400 - 2.483GHz"
            },
            "provider": {
              "name": "Garuda Robotics Pte Ltd",
              "brand": "Garuda",
              "company_logo": "",
              "country": "Singapore",
              "id": "0c5c21b6a42fadb018a5d1863c34b35d"
            }
          },
          "notes": "Industrial-grade quadrotor UAV suitable for a variety of applications.",
          "shared": false,
          "serviceable": true,
          "aquired_on": 1532103688243
        }
      ],
      "deployment_lead": {
        "name": "USER-001",
        "user_id": "3b20c067ab91da9436ddaea6b83a9536"
      },
      "purpose": [
        "Demonstration",
        "Training (Academy)"
      ],
      "start_date": 1559571926000,
      "end_date": 1559572026000,
      "targets": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    103.78140449523926,
                    1.292500533024804
                  ],
                  [
                    103.78011703491211,
                    1.2929295772415663
                  ],
                  [
                    103.78028869628905,
                    1.2908701643402538
                  ],
                  [
                    103.78286361694336,
                    1.2922431064599564
                  ],
                  [
                    103.78140449523926,
                    1.292500533024804
                  ]
                ]
              ]
            }
          }
        ]
      },
      "create_date": 1562216203843,
      "last_modified_date": 1562216203843,
      "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536"
    }
    

    PATCH /deployments/{deployment_id}

    Update a specific deployment belonging to the company of the user.

    To update a specific deployment, you can pass whichever properties that you wish to update in the request body. All properties are optional.

    Property Type Description
    name String Name of the deployment
    project_id String Project ID that this deployment is part of
    drones Array Array of drone IDs to be used for the deployment
    deployment_lead_id String User ID of the deployment lead
    start_date Number Start date of deployment in epoch (Unix timestamp), converted to milliseconds (ms)
    end_date Number End date of deployment in epoch (Unix timestamp), converted to milliseconds (ms)
    targets Object GeoJSON FeatureCollection representation of the deployment area
    purpose String Description of the purpose of deployment
    batteries Array Array of battery IDs to be used for the deployment
    cameras Array Array of camera IDs to be used for the deployment
    payloads Array Array of strings, each describing a payload tagged to the deployment
    personnel Array Array of user IDs of the personnel involved in the deployment
    status String Enumerated string describing the status of the deployment.
    checklist Array Array of objects, each describing a an equipment (drone, battery or camera) that is registered to the deployment, or a custom object that is also needed for the deployment.

    A deployment that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated deployment object.

    Delete a deployment

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/deployments/{deployment_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/deployments/{deployment_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/deployments/{deployment_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/deployments/{deployment_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "name": "DEPLOYMENT-001",
      "deployment_id": "9703889c2bb4322025815ed1a0509eba",
      "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
      "project_id": "2b6d1671011c488c6583f07824fbf2c1",
      "drones": [
        {
          "name": "DRONE-001",
          "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
          "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
          "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79",
          "model": {
            "name": "M400 UAV",
            "provider_id": "0c5c21b6a42fadb018a5d1863c34b35d",
            "category": "Quadcopter",
            "avatar": "",
            "compatibility": {
              "batteries": [
                "0c5c21b6a42fadb018a5d1863c37bb31",
                "0c5c21b6a42fadb018a5d1863c36abd6"
              ],
              "cameras": [
                "0c5c21b6a42fadb018a5d1863c35dc93",
                "0c5c21b6a42fadb018a5d1863c35fea4"
              ],
              "payloads": []
            },
            "weight_kg": "2.100",
            "properties": {
              "dimensions": {
                "width": "0.82",
                "length": "0.82",
                "height": "0.28"
              },
              "max_flight_time": "25",
              "rc_frequency": "2.400 - 2.483GHz"
            },
            "provider": {
              "name": "Garuda Robotics Pte Ltd",
              "brand": "Garuda",
              "company_logo": "",
              "country": "Singapore",
              "id": "0c5c21b6a42fadb018a5d1863c34b35d"
            }
          },
          "notes": "Industrial-grade quadrotor UAV suitable for a variety of applications.",
          "shared": false,
          "serviceable": true,
          "aquired_on": 1532103688243
        }
      ],
      "deployment_lead": {
        "name": "USER-001",
        "user_id": "3b20c067ab91da9436ddaea6b83a9536"
      },
      "purpose": [
        "Aerial Photography"
      ],
      "start_date": 1559571926000,
      "end_date": 1559572026000,
      "targets": {
        "type": "FeatureCollection",
        "features": [
          {
            "type": "Feature",
            "properties": {},
            "geometry": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    103.78140449523926,
                    1.292500533024804
                  ],
                  [
                    103.78011703491211,
                    1.2929295772415663
                  ],
                  [
                    103.78028869628905,
                    1.2908701643402538
                  ],
                  [
                    103.78286361694336,
                    1.2922431064599564
                  ],
                  [
                    103.78140449523926,
                    1.292500533024804
                  ]
                ]
              ]
            }
          }
        ]
      },
      "create_date": 1562216203843,
      "last_modified_date": 1562216203843,
      "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536"
    }
    

    DELETE /deployments/{deployment_id}

    Delete a specific deployment belonging to the company of the user. A valid deployment_id in the path parameter is required for a successful call.

    A successful deletion will return a 200 OK status and the deleted deployment object in the response body.

    Flight Plans

    Every flight requires a valid and approved flight plan before your drone can safely take off. There are many factors that need to be taken into account when creating a flight plan, including the plan type, requirements, commands, and more. Every flight plan must be tagged to an existing deployment, and each flight plan can be reused as required for multiple flight sessions.

    The plan object within the flight_plan contains the main commands that will be executed during the flight. Each command object contains some parameters that will determine the absolute flight path of the drones. This path will also have to be within the deployment_area of the deployment, which should have been earlier specified by a GeoJSON FeatureCollection.

    A full flight_plan object, including all optional properties

    {
      "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
      "deployment_id": "9703889c2bb4322025815ed1a0509eba",
      "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
      "description": "FLIGHTPLAN-001",
      "drones": [
        {
          "name": "DRONE-001",
          "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
          "model_name": "M400 UAV",
          "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
        }
      ],
      "last_modified_date": "1245591926000",
      "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536",
      "plan_type": "ardupilot",
      "plan": {
        "requirements": {
          "RTL_ALT": 3000,
          "FS_BATT_ENABLE": 2,
          "FS_GCS_ENABLE": 2,
          "FS_THR_ENABLE": 1
        },
        "commands": [
          {
            "id": "22",
            "param1": "15",
            "param2": "16",
            "param3": "17",
            "param4": "18",
            "param5": "19",
            "param6": "20",
            "param7": "21",
            "description": "Take off (location TBD)",
            "properties": { // Optional properties
              "conditionYawTarget": { 
                  "lat": "2.0",
                  "lng": "104.0"
              }
            }
          }
        ],
        "home_location": {
          "lat": "1.0",
          "lng": "103.0"
        },
        "rtl_path": [
          {
            "id": "20",
            "param1": "",
            "param2": "",
            "param3": "",
            "param4": "",
            "param5": "",
            "param6": "",
            "param7": "",
            "description": "Survey complete, return to launch location"
          }
        ]
      }
    }
    

    Each flight plan object will have the following properties:

    Property Type Description
    flight_plan_id String Unique flight plan ID
    deployment_id String Deployment ID that the flight plan is tagged to
    company_id String Unique company ID
    description String Description of the flight plan
    drones Array Array of drone objects, specifying the drones that this flight plan is allowed fly.
    last_modified_date String Date of last modification to flight plan in epoch (Unix timestamp), converted to milliseconds (ms)
    last_modified_by String User ID of the user that last modified the flight plan
    plan_type String The type of the flight plan: currently only arudpilot is supported
    plan Object Object representing the details of the flight plan

    The plan object is represented by the following properties:

    Property Type Description
    requirements Object Object representing the requirements of the flight plan. Requirements to be described as parameters. 4 different parameters are supported: RTL_ALT, FS_BATT_ENABLE, FS_GCS_ENABLE, FS_THR_ENABLE. Refer to the ardupilot documentation for information on these parameters.
    commands Array Array of objects representing the commands that will be executed during the flight plan. Each command is made up of an id, 7 parameters, a description and some optional properties.
    home_location Object Object with properties lat and lng, specifying where the drone will take off from. This property is optional.
    rtl_path Array Array of objects representing the commands that define a custom 'Return To Launch' (RTL) path that will override the default RTL behaviour. This property is optional.

    A command object has an ID, 7 command parameters and a description. The 7 parameters follow the ardupilot MAVLINK command parameters:

    Command Parameter Description
    param1 Hold time at mission waypoint in decimal seconds - MAX 65535 seconds. (Copter/Rover only)
    param2 Acceptance radius in meters (when plain inside the sphere of this radius, the waypoint is considered reached) (Plane only).
    param3 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.
    param4 Desired yaw angle at waypoint target.(rotary wing)
    param5 Target latitude. If zero, the Copter will hold at the current latitude.
    param6 Target longitude. If zero, the Copter will hold at the current longitude.
    param7 Target altitude. If zero, the Copter will hold at the current altitude.

    Get all flight plans

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/flight_plans',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/flight_plans', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/flight_plans' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_plans',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
          "deployment_id": "9703889c2bb4322025815ed1a0509eba",
          "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
          "description": "FLIGHTPLAN-001",
          "drones": [
            {
              "name": "DRONE-001",
              "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
              "model_name": "M400 UAV",
              "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
            }
          ],
          "last_modified_date": "1245591926000",
          "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536",
          "plan_type": "ardupilot",
          "plan": {
            "requirements": {
              "RTL_ALT": 3000,
                    "FS_BATT_ENABLE": 2,
                    "FS_GCS_ENABLE": 2,
                    "FS_THR_ENABLE": 1
            },
            "commands": [
              {
                "id": "22",
                "param1": "15",
                "param2": "16",
                "param3": "17",
                "param4": "18",
                "param5": "19",
                "param6": "20",
                "param7": "21",
                "description": "Take off (location TBD)"
              }
            ]
          }
        }
      ]
    }
    

    GET /flight_plans

    GET /flight_plans?deployment_id=

    You can get all flight plans belonging to your company or belonging to a specific deplyoment via this endpoint. If you wish to filter and retrieve flight plans from only a specific deployment, you should specify the deployment_id via the query string. Otherwise, if no deployment_id is specified, all flight plans belonging to your company will be retrieved.

    The response body of this endpoint will contain an array of all the flight_plan objects.

    Create new flight plan

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/flight_plans',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/flight_plans', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/flight_plans' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "description": "FLIGHTPLAN-001",
          "plan_type": "ardupilot",
          "drones": [
            "ceaf7e6dc205b365e156bf4f86930408"
          ],
          "plan": {
            "requirements": {
              "RTL_ALT": 3000,
              "FS_BATT_ENABLE": 2,
              "FS_GCS_ENABLE": 2,
              "FS_THR_ENABLE": 1
            },
            "commands": [
              {
                "id": "22",
                "param1": "15",
                "param2": "16",
                "param3": "17",
                "param4": "18",
                "param5": "19",
                "param6": "20",
                "param7": "21",
                "description": "Take off (location TBD)"
              }
            ]
          }
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "description": "FLIGHTPLAN-001",
      "plan_type": "ardupilot",
      "drones": [
        "ceaf7e6dc205b365e156bf4f86930408"
      ],
      "plan": {
        "requirements": {
          "RTL_ALT": 3000,
          "FS_BATT_ENABLE": 2,
          "FS_GCS_ENABLE": 2,
          "FS_THR_ENABLE": 1
        },
        "commands": [
          {
            "id": "22",
            "param1": "15",
            "param2": "16",
            "param3": "17",
            "param4": "18",
            "param5": "19",
            "param6": "20",
            "param7": "21",
            "description": "Take off (location TBD)"
          }
        ]
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_plans',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
        "deployment_id": "9703889c2bb4322025815ed1a0509eba",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "description": "FLIGHTPLAN-001",
        "drones": [
          {
            "name": "DRONE-001",
            "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
            "model_name": "M400 UAV",
            "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
          }
        ],
        "last_modified_date": "1245591926000",
        "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536",
        "plan_type": "ardupilot",
        "plan": {
          "requirements": {
            "RTL_ALT": 3000,
            "FS_BATT_ENABLE": 2,
            "FS_GCS_ENABLE": 2,
            "FS_THR_ENABLE": 1
          },
          "commands": [
            {
              "id": "22",
              "param1": "15",
              "param2": "16",
              "param3": "17",
              "param4": "18",
              "param5": "19",
              "param6": "20",
              "param7": "21",
              "description": "Take off (location TBD)"
            }
          ]
        }
      }
    }
    

    POST /flight_plans

    Create a new flight plan for a deployment belonging to the company of the user.

    You should pass in at minimum the following details in the request body:

    Property Type Description
    deployment_id String Valid deployment ID tagged to this flight plan
    plan_type String The type of the flight plan
    description String Description of the flight plan
    plan Object Object representing the actual flight plan

    Optionally, you can pass in more details regarding your flight plan:

    Property Type Description
    drones Array Array of valid drone IDs to be used during the flight

    Within the plan object, there are some properties that are optional:

    Property Type Required Description
    requirements Object true Requirements of the flight plan. Object containing properties RTL_ALT, FS_BATT_ENABLE, FS_GCS_ENABLE, FS_THR_ENABLE
    commands Array true Array of command objects representing the flight plan.
    home_location Object false Object with properties lat and long, specifying the home location of the flight.
    rtl_path Array false Array of command objects representing a custom RTL path.

    Refer to the description of the flight plan object for more details on each property.

    Get a flight plan

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/flight_plans/{flight_plan_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/flight_plans/{flight_plan_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/flight_plans/{flight_plan_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_plans/{flight_plan_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    GET /flight_plans/{flight_plan_id}

    Get a specific flight plan for a deployment belonging to the company of the user.

    200 Response

    {
      "success": true,
      "data": {
        "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
        "deployment_id": "9703889c2bb4322025815ed1a0509eba",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "description": "FLIGHTPLAN-001",
        "drones": [
          {
            "name": "DRONE-001",
            "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
            "model_name": "M400 UAV",
            "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
          }
        ],
        "last_modified_date": "1245591926000",
        "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536",
        "plan_type": "ardupilot",
        "plan": {
          "requirements": {
            "RTL_ALT": 3000,
            "FS_BATT_ENABLE": 2,
            "FS_GCS_ENABLE": 2,
            "FS_THR_ENABLE": 1
          },
          "commands": [
            {
              "id": "22",
              "param1": "15",
              "param2": "16",
              "param3": "17",
              "param4": "18",
              "param5": "19",
              "param6": "20",
              "param7": "21",
              "description": "Take off (location TBD)"
            }
          ]
        }
      }
    }
    

    Update a flight plan

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/flight_plans/{flight_plan_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/flight_plans/{flight_plan_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    PATCH https://api.garuda.io/v2/flight_plans/{flight_plan_id} HTTP/1.1
    Host: api.garuda.io/v2
    Content-Type: application/json
    Accept: application/json
    
    
    curl -X PATCH 'https://api.garuda.io/v2/flight_plans/{flight_plan_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "description": "FLIGHTPLAN-001_rev-1"
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "description": "FLIGHTPLAN-001_rev-1"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_plans/{flight_plan_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
        "deployment_id": "9703889c2bb4322025815ed1a0509eba",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "description": "FLIGHTPLAN-001_rev-1",
        "drones": [
          {
            "name": "DRONE-001",
            "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
            "model_name": "M400 UAV",
            "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
          }
        ],
        "last_modified_date": "1245591926000",
        "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536",
        "plan_type": "ardupilot",
        "plan": {
          "requirements": {
            "RTL_ALT": 3000,
            "FS_BATT_ENABLE": 2,
            "FS_GCS_ENABLE": 2,
            "FS_THR_ENABLE": 1
          },
          "commands": [
            {
              "id": "22",
              "param1": "15",
              "param2": "16",
              "param3": "17",
              "param4": "18",
              "param5": "19",
              "param6": "20",
              "param7": "21",
              "description": "Take off (location TBD)"
            }
          ]
        }
      }
    }
    

    PATCH /flight_plans/{flight_plan_id}

    To update a flight plan, you can pass in any subset of the following properties in the request body:

    Property Type Description
    deployment_id String A valid deployment ID that the flight plan is tagged to
    plan_type String The type of the flight plan
    description String Description of the flight plan
    requirements Object Requirements of the flight plan.
    commands Array Array of objects representing the commands that will be executed during the flight plan.
    home_location Object Object with properties lat and lng, specifying where the drone will take off from.
    rtl_path Array Array of objects representing the commands that define a custom 'Return To Launch' (RTL) path.

    Only the properties specified in the request body will be updated in the flight_plan, and the rest of the properties will remain unchanged. For more detailed information on these properties, refer to the specification at the start of this section.

    A flight plan that has been successfully updated will return a response with a "success": true body and a 200 OK status. The response body will also contain the updated flight_plan object.

    Delete a flight plan

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/flight_plans/{flight_plan_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/flight_plans/{flight_plan_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/flight_plans/{flight_plan_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_plans/{flight_plan_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    DELETE /flight_plans/{flight_plan_id}

    Delete a specific flight plan for a deployment belonging to the company of the user.

    A successful deletion will return a 200 OK status and the deleted flight plan object in the response body.

    200 Response

    {
      "success": true,
      "data": {
        "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
        "deployment_id": "9703889c2bb4322025815ed1a0509eba",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "description": "FLIGHTPLAN-001",
        "drones": [
          {
            "name": "DRONE-001",
            "drone_id": "ceaf7e6dc205b365e156bf4f86930408",
            "model_name": "M400 UAV",
            "model_id": "7bd6798cdb0dcb26ca6d3c0ca9c2ae79"
          }
        ],
        "last_modified_date": "1245591926000",
        "last_modified_by": "3b20c067ab91da9436ddaea6b83a9536",
        "plan_type": "ardupilot",
        "plan": {
          "requirements": {
            "RTL_ALT": 3000,
            "FS_BATT_ENABLE": 2,
            "FS_GCS_ENABLE": 2,
            "FS_THR_ENABLE": 1
          },
          "commands": [
            {
              "id": "22",
              "param1": "15",
              "param2": "16",
              "param3": "17",
              "param4": "18",
              "param5": "19",
              "param6": "20",
              "param7": "21",
              "description": "Take off (location TBD)"
            }
          ]
        }
      }
    }
    

    Flight Sessions

    Once you have your flight plan approved, you are ready to fly!

    Each drone flight is represented by a flight session. Each flight session must be tagged to a valid and approved flight plan and an existing deployment. This set of endpoints allow you to manage and log the flight history of your deployments easily.

    A flight session essentially tracks the flight plan of the flight, as well as the start and end time of the flight.

    A flight session has the following properties:

    Property Type Description
    company_id String Company ID that the flight session is tagged to
    deployment_id String A valid deployment ID
    flight_plan_id String A valid and approved flight plan ID
    start_date_time String Start time of flight session in epoch (Unix timestamp), converted to milliseconds
    end_date_time String End time of flight session in epoch (Unix timestamp), converted to milliseconds (ms)

    Get all flight sessions

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/flight_sessions',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/flight_sessions', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/flight_sessions' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_sessions',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "flight_session_id": "0b28db84d57ea15b5c26e5c3ffce67fc",
          "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
          "deployment_id": "9703889c2bb4322025815ed1a0509eba",
          "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
          "start_date_time": 1527469200000,
          "end_date_time": 1527479200000
        }
      ]
    }
    

    GET /flight_sessions

    GET /flight_sessions?deployment_id=<DEPLOYMENT_ID>

    GET /flight_sessions?flight_plan_id=<FLIGHT_PLAN_ID>

    GET /flight_sessions?deployment_id=<DEPLOYMENT_ID>&flight_plan_id=<FLIGHT_PLAN_ID>

    You can get all the flight sessions belonging to your company, filtered by deployment_id or flight_plan_id which can be specified as a query string. If both query strings are specified, only flight sessions that match both will be fetched. If none of the queries are specified, all flight sessions belonging to your company will be retrieved.

    The response body for this endpoint will contain an array of all the flight_session objects.

    Create new flight session

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/flight_sessions',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/flight_sessions', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/flight_sessions' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "deployment_id": "9703889c2bb4322025815ed1a0509eba",
          "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
          "start_date_time": 1527469200000,
          "end_date_time": 1527479200000
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "deployment_id": "9703889c2bb4322025815ed1a0509eba",
      "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
      "start_date_time": 1527469200000,
      "end_date_time": 1527479200000
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_sessions',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "flight_session_id": "0b28db84d57ea15b5c26e5c3ffce67fc",
        "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "deployment_id": "9703889c2bb4322025815ed1a0509eba",
        "start_date_time": 1527469200000,
        "end_date_time": 1527479200000
      }
    }
    

    POST /flight_sessions

    This endpoint allows you to create a new flight session for a specific deployment.

    You should pass in at minimum the following details in the request body:

    Item Type Description
    deployment_id String A valid deployment ID belonging to your company
    flight_plan_id String A valid and approved flight plan ID
    start_date_time String Start time of flight session in epoch (Unix timestamp), converted to milliseconds
    end_date_time String End time of flight session in epoch (Unix timestamp), converted to milliseconds (ms)

    Get a flight session

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/flight_sessions/{flight_session_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/flight_sessions/{flight_session_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/flight_sessions/{flight_session_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_sessions/{flight_session_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "flight_session_id": "0b28db84d57ea15b5c26e5c3ffce67fc",
        "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
        "deployment_id": "9703889c2bb4322025815ed1a0509eba",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "start_date_time": 1527469200000,
        "end_date_time": 1527479200000
      }
    }
    

    GET /flight_sessions/{flight_session_id}

    Get a specific flight session for a deployment belonging to the company of the user.

    Update a flight session

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/flight_sessions/{flight_session_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/flight_sessions/{flight_session_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/flight_sessions/{flight_session_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
           "end_date_time": 1527480200000
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "end_date_time": 1527480200000
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_sessions/{flight_session_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "flight_session_id": "0b28db84d57ea15b5c26e5c3ffce67fc",
        "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
        "deployment_id": "9703889c2bb4322025815ed1a0509eba",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "start_date_time": 1527469200000,
        "end_date_time": 1527480200000
      }
    }
    

    PATCH /flight_sessions/{flight_session_id}

    Update a specific flight session for a deployment belonging to the company of the user.

    To update a flight session, you can pass in any subset of the properties of the flight session in the request body. All properties are optional.

    Property Type Description
    start_date_time String Start time of flight session in epoch (Unix timestamp), converted to milliseconds
    end_date_time String End time of flight session in epoch (Unix timestamp), converted to milliseconds (ms)

    A flight session that has been successfully updated will return a response with a "success": true body and a 200 OK status.

    Delete a flight session

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/flight_sessions/{flight_session_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/flight_sessions/{flight_session_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/flight_sessions/{flight_session_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/flight_sessions/{flight_session_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "flight_session_id": "0b28db84d57ea15b5c26e5c3ffce67fc",
        "flight_plan_id": "fc5583b754db73cc526a6ffa919d393a",
        "deployment_id": "9703889c2bb4322025815ed1a0509eba",
        "company_id": "ca42ab884a633d6a823b45e6ebe9534c",
        "start_date_time": 1527469200000,
        "end_date_time": 1527479200000
      }
    }
    

    DELETE /flight_sessions/{flight_session_id}

    Delete a specific flight session for a deployment belonging to the company of the user.

    A successful deletion will return a 200 OK status and the deleted flight session object in the response body.

    Fleet API

    The Fleet APIs allows you to manage companies, users, drones and equipment.

    Drones

    Fleet APIs allow you to manage your drones easily and in an organised manner. You can easily track a lot of different data and information about each drone, using a drone object that has the following properties:

    Property Type Description
    name String Name of the drone
    drone_id String Drone ID
    model Object Object representing the drone model. Contains the name of the model and the model_id
    notes String Descriptive notes for the drone
    acquired_on String Date that drone was acquired on, in epoch (Unix timestamp), converted to milliseconds
    serviceable Boolean Boolean representing drone's serviceability status (insert what serviceable means here)
    shared Boolean Boolean representing drone's shared status. (insert what shared means here)

    Get all drones

    Code samples

    require 'rest-client'
    require 'json'
    headers = {
      'Accept' => 'application/json'
    }
    result = RestClient.get 'https://api.garuda.io/v2/fleet/drones',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/drones', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/fleet/drones' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drones',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "DRONE-001",
          "drone_id": "707548a02a1046bd358c54728e5b6156",
          "model": {
            "name": "M400 UAV",
            "model_id": "04e181a4b0dc28898b6f51f9d918bb8e"
          },
          "notes": "Purpose: Security Surveillance",
          "acquired_on": 1554090304172,
          "serviceable": true,
          "shared": false
        },
        {
          "name": "DRONE-002",
          "drone_id": "3a5890b4bae2846f65353992a4b70259",
          "model": {
            "name": "M408 UAV",
            "model_id": "5bb1ef3af490e4e49ad5b369e8b6991f"
          },
          "notes": "Purpose: Plantation",
          "acquired_on": 1554090304172,
          "serviceable": true,
          "shared": false
        }
      ]
    }
    

    GET /fleet/drones

    Get all drones belonging to the company of the user. This endpoint returns an array of JSON objects, with each object representing a drone in the database.

    Create new drone

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/drones',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/drones', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/drones' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "DRONE-001",
          "model_id": "04e181a4b0dc28898b6f51f9d918bb8e",
          "notes": "Purpose: Security Surveillance",
          "serviceable": true,
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "DRONE-001",
      "model_id": "7e7ed56fed0be0f555f8374e980056cd",
      "notes": "Primary purpose of drone: surveillance",
      "acquired_on": 1554090304172,
      "serviceable": true,
      "shared": false
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drones',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "DRONE-001",
        "drone_id": "707548a02a1046bd358c54728e5b6156",
        "model": {
          "name": "M400 UAV",
          "model_id": "04e181a4b0dc28898b6f51f9d918bb8e"
        },
        "notes": "Purpose: Security Surveillance",
        "acquired_on": 1554090304172,
        "serviceable": true,
        "shared": false
      }
    }
    

    POST /fleet/drones

    Create a new drone belonging to the company of the user. At minimum, you should pass in the following details in the request body:

    Property Type Description
    name String Name of the drone
    model_id String Model ID of the drone

    model_id has to be a valid model ID that already exists in the database.

    There are some additional details that you can add to the request body to flesh out your drone details even further:

    Property Type Description
    notes String Descriptive notes for the drone
    acquired_on String Date that drone was acquired on, in epoch (Unix timestamp), converted to milliseconds
    serviceable Boolean Boolean representing drone's serviceability status
    shared Boolean Boolean representing drone's shared status.

    A drone that has been successfully created will return a response with a "success": true body and a 200 OK status.

    Get a drone

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/drones/{drone_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/drones/{drone_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/drones/{drone_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drones/{drone_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "DRONE-001",
        "drone_id": "707548a02a1046bd358c54728e5b6156",
        "model": {
          "name": "M400 UAV",
          "model_id": "04e181a4b0dc28898b6f51f9d918bb8e"
        },
        "notes": "Purpose: Security Surveillance",
        "acquired_on": 1554090304172,
        "serviceable": true,
        "shared": false
      }
    }
    

    GET /fleet/drones/{drone_id}

    Get a specific drone belonging to the company of the user.

    drone_id parameter has to be a valid drone ID.

    Update a drone

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/drones/{drone_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/drones/{drone_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/drones/{drone_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "model_id": "5bb1ef3af490e4e49ad5b369e8b6991f",
          "serviceable": false,
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "model_id": "5bb1ef3af490e4e49ad5b369e8b6991f",
      "serviceable": false,
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drones/{drone_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "DRONE-001",
        "drone_id": "707548a02a1046bd358c54728e5b6156",
        "model": {
          "name": "M408 UAV",
          "model_id": "5bb1ef3af490e4e49ad5b369e8b6991f"
        },
        "notes": "Purpose: Security Surveillance",
        "acquired_on": 1554090304172,
        "serviceable": false,
        "shared": false
      }
    }
    

    PATCH /fleet/drones/{drone_id}

    Update a specific drone belonging to the company of the user.

    To update a specific drone, you can pass whichever properties that you wish to update in the request body. All properties are optional.

    Property Type Description
    name String Name of the drone
    drone_id String Drone ID
    model Object Object representing the drone model. Contains the name of the model and the model_id
    notes String Descriptive notes for the drone
    acquired_on String Date that drone was acquired on, in epoch (Unix timestamp), converted to milliseconds
    serviceable Boolean Boolean representing drone's serviceability status (insert what serviceable means here)
    shared Boolean Boolean representing drone's shared status. (insert what shared means here)

    A drone that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated drone object.

    Delete a drone

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/drones/{drone_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/drones/{drone_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/drones/{drone_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drones/{drone_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "DRONE-001",
        "drone_id": "7e7ed56fed0be0f555f8374e980056cd",
        "model": {
          "name": "M400 UAV",
          "model_id": "7e7ed56fed0be0f555f8374e980056cd"
        },
        "notes": "Primary purpose of drone: surveillance",
        "acquired_on": 1554090304172,
        "serviceable": true,
        "shared": false
      }
    }
    

    DELETE /fleet/drones/{drone_id}

    Delete a specific drone belonging to the company of the user. A valid drone_id in the path parameter is required for a successful call.

    A successful deletion will return a 200 OK status and the deleted drone object in the response body.

    Drone Providers

    Drone providers are companies/brands that supply drones to consumers. The Fleet APIs allow you to manage your company's drone providers, with each drone_provider object having the following properties:

    Property Type Description
    name String Name of the drone provider
    drone_provider_id String A unique drone provider ID
    brand String Brand name of the drone provider
    country String Country of origin of drone provider

    Get all drone providers

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/drone-providers',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/drone-providers', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/drone-providers' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "Garuda Robotics Pte. Ltd.",
          "drone_provider_id": "d2a99141fd4122869b5099138a5124d2",
          "brand": "Garuda",
          "country": "Singapore"
        },
        {
          "name": "Rugada Robotics Pte. Ltd.",
          "drone_provider_id": "fda3963d33db33c5023d33b5e863a19f",
          "brand": "Rugada",
          "country": "Singapore"
        }
      ]
    }
    

    GET /fleet/drone-providers

    Get all drones providers belonging to the company of the user. The response returns an array of all the drone_provider objects that belong to your company.

    Create new drone provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/drone-providers',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/drone-providers', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/drones-providers' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "Garuda Robotics Pte. Ltd.",
          "brand": "Garuda",
          "country": "Singapore"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "Garuda Robotics Pte. Ltd.",
      "brand": "Garuda",
      "country": "Singapore"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Garuda Robotics Pte. Ltd.",
        "drone_provider_id": "d2a99141fd4122869b5099138a5124d2",
        "brand": "Garuda",
        "country": "Singapore"
      }
    }
    

    POST /fleet/drone-providers

    Create a new drone provider belonging to the company of the user. For this POST method, all the following fields are required in the request body for a successful call:

    Property Type Description
    name String Name of the drone provider
    brand String Brand name of the drone provider
    country String Country of origin of drone provider

    A drone provider that has been successfully created will return a response with a "success": true body and a 200 OK status.

    Get a drone provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/drones-providers/{drone_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Garuda Robotics Pte. Ltd.",
        "drone_provider_id": "d2a99141fd4122869b5099138a5124d2",
        "brand": "Garuda",
        "country": "Singapore"
      }
    }
    

    GET /fleet/drone-providers/{drone_provider_id}

    Get a specific drone provider belonging the company of the user.

    Update a drone provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/drones-providers/{drone_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "brand": "Garuda Robotics"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "brand": "Garuda Robotics"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Garuda Robotics Pte. Ltd.",
        "drone_provider_id": "d2a99141fd4122869b5099138a5124d2",
        "brand": "Garuda Robotics",
        "country": "Singapore"
      }
    }
    

    PATCH /fleet/drone-providers/{drone_provider_id}

    Update a specific drone provider belonging the company of the user. For this endpoint, all the fields are optional:

    Property Type Description
    name String Name of the drone provider
    brand String Brand name of the drone provider
    country String Country of origin of drone provider

    A drone provider that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated drone_provider object.

    Delete a drone provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/drones-providers/{drone_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Garuda Robotics Pte. Ltd.",
        "drone_provider_id": "d2a99141fd4122869b5099138a5124d2",
        "brand": "Garuda",
        "country": "Singapore"
      }
    }
    

    DELETE /fleet/drone-providers/{drone_provider_id}

    Delete a specific drone provider belonging to the company of the user. A valid drone_provider_id in the path parameter is required for a successful call.

    A successful deletion will return a 200 OK status and the deleted drone_provider object in the response body.

    Drone Models

    Fleet APIs allow you to manage drone models. Each drone_model object contains information regarding a specific drone model provided by a drone provider. A drone_model object has the following properties:

    Property Type Description
    name String Name of the drone model
    model_id String Drone model ID
    provider Object Object representing the drone provider. Contains the name of the provider and the provider_id
    category String Name of category of drone
    avatar String Path to the avatar file for the drone model
    compatibility Object An object containing two arrays, batteries and cameras, each containing a list of battery and camera objects respectively that are compatible with this drone model.
    weight String Weight of the drone in kilograms (kg)
    properties Object Object representing the properties of this drone model. (see below)

    Each drone_model has a set of properties that describes the specifications of the drone model. The properties in the drone_model is an object with the following properties:

    Property Type Description
    dimensions Object Dimensions of drone. Object has the properties width, length, and height (m)
    max_flight_time String Description of the maximum flight time of the drone
    rc_frequency String The RC frequency at which the drone operates at

    Get all drone models

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "M400 UAV",
          "model_id": "04e181a4b0dc28898b6f51f9d918bb8e",
          "provider": {
            "name": "Garuda Robotics Pte. Ltd.",
            "provider_id": "d2a99141fd4122869b5099138a5124d2"
          },
          "category": "Quadcopter"
        }
      ]
    }
    

    GET /fleet/drone-providers/{drone_provider_id}/drone-models

    When getting all drone_models belonging to a specific drone provider in your company, you have to provide a valid and existing drone_provider_id. The HTTP response body will contain an array of drone_model objects belonging to your specified drone_provider.

    You can specify the extent of which to fetch the data via query strings:

    Query Default Values Description
    options shallow shallow, deep Specify if data retrieved should be a deep or shallow fetch

    For a shallow fetch (which is the default behaviour), only the name, provider, avatar and category will be retrieved (see sample response on the left for how this will look like). A deep fetch will retrieve more information for each of the objects -- to see the exact properties that will be retrieved with a deep fetch, refer to the beginning of this section.

    Create new drone model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "M400 UAV",
          "provider_id": "d2a99141fd4122869b5099138a5124d2",
          "category": "Quadcopter",
          "weight": 2.8,
          "properties": {
            "dimensions": {
              "width": "1.30",
              "length": "1.30",
              "height": "0.30"
            },
            "max_flight_time": "26 mins",
            "rc_frequency": "2.400GHz"
          }
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "M400 UAV",
      "provider_id": "d2a99141fd4122869b5099138a5124d2",
      "category": "Quadcopter",
      "weight": 2.8,
      "properties": {
        "dimensions": {
          "width": "1.30",
          "length": "1.30",
          "height": "0.30"
        },
        "max_flight_time": "26 mins",
        "rc_frequency": "2.400GHz"
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "M400 UAV",
        "provider": {
          "name": "Garuda Robotics Pte. Ltd.",
          "provider_id": "d2a99141fd4122869b5099138a5124d2",
        },
        "category": "Quadcopter",
        "weight": 2.8,
        "properties": {
          "dimensions": {
            "width": "1.30",
            "length": "1.30",
            "height": "0.30"
          },
          "max_flight_time": "26 mins",
          "rc_frequency": "2.400GHz"
        }
      }
    }
    

    POST /fleet/drone-providers/{drone_provider_id}/drone-models

    Every created drone_model has to belong to a valid and existing drone_provider. When calling this API, the drone_provider_id parameter has to be valid for a successful call.

    When creating a new drone_model, at minimum, you should pass in values for the following properties:

    Property Type Description
    name String Name of the drone model
    model_id String Drone model ID
    provider Object Object representing the drone provider. Contains the name of the provider and the provider_id
    category String Name of category of drone
    avatar String Path to the avatar file for the drone model
    weight String Weight of the drone in kilograms (kg)
    properties Object Object representing the properties of this drone model. (see below)

    For more information on these properties, refer to the drone_model object description at the beginning of this section

    You can also choose to pass in equipment compatibility information if you wish.

    Property Type Description
    compatibility Object An object containing two arrays, batteries and cameras, each containing a list of battery and camera objects respectively that are compatible with this drone model.

    Otherwise, compatibility can also be added at a later time with the PATCH endpoint.

    Update a drone model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "compatibility": {
            "batteries": [
              {
                "name": "BATTERY-001",
                "battery_id": "f42074ff0948fbb1d11f7a96c07cdcdd",
                "model_name": "Multistar 6S 6600",
              }
            ],
            "cameras": [
              {
                "name": "CAMERA-001",
                "camera_id": "0b53479856488f542a18fef96b84119d",
                "model_name": "Powershot S100",
              }
            ]
          }
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "compatibility": {
        "batteries": [
          {
            "name": "BATTERY-001",
            "battery_id": "f42074ff0948fbb1d11f7a96c07cdcdd",
            "model_name": "Multistar 6S 6600",
          }
        ],
        "cameras": [
          {
            "name": "CAMERA-001",
            "camera_id": "0b53479856488f542a18fef96b84119d",
            "model_name": "Powershot S100",
          }
        ]
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "M400 UAV",
        "provider": {
          "name": "Garuda Robotics Pte. Ltd.",
          "provider_id": "d2a99141fd4122869b5099138a5124d2",
        },
        "category": "Quadcopter",
        "weight": 2.8,
        "compatibility": {
          "batteries": [
            {
              "name": "BATTERY-001",
              "battery_id": "f42074ff0948fbb1d11f7a96c07cdcdd",
              "model_name": "Multistar 6S 6600",
            }
          ],
          "cameras": [
            {
              "name": "CAMERA-001",
              "camera_id": "0b53479856488f542a18fef96b84119d",
              "model_name": "Powershot S100",
            }
          ]
        },
        "properties": {
          "dimensions": {
            "width": "1.30",
            "length": "1.30",
            "height": "0.30"
          },
          "max_flight_time": "26 mins",
          "rc_frequency": "2.400GHz"
        }
      }
    }
    

    PATCH /fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}

    This endpoint allows you to edit and update information regarding a drone_model that has already been created. For the request body of this endpoint, it is not necessary to pass in values for all the properties of a drone_model. All of the following properties are optional:

    Property Type Description
    name String Name of the drone model
    model_id String Drone model ID
    provider Object Object representing the drone provider. Contains the name of the provider and the provider_id
    category String Name of category of drone
    avatar String Path to the avatar file for the drone model
    compatibility Object An object containing two arrays, batteries and cameras, each containing a list of battery and camera objects respectively that are compatible with this drone model.
    weight String Weight of the drone in kilograms (kg)
    properties Object Object representing the properties of this drone model. (see below)

    For more information on these properties, refer to the drone_model object description at the beginning of this section

    A drone_model that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated drone_model object.

    Delete a drone model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "M400 UAV",
        "provider": {
          "name": "Garuda Robotics Pte. Ltd.",
          "provider_id": "d2a99141fd4122869b5099138a5124d2",
        },
        "category": "Quadcopter",
        "weight": 2.8,
        "compatibility": {
          "batteries": [
            {
              "name": "BATTERY-001",
              "battery_id": "f42074ff0948fbb1d11f7a96c07cdcdd",
              "model_name": "Multistar 6S 6600",
            }
          ],
          "cameras": [
            {
              "name": "CAMERA-001",
              "camera_id": "0b53479856488f542a18fef96b84119d",
              "model_name": "Powershot S100",
            }
          ]
        },
        "properties": {
          "dimensions": {
            "width": "1.30",
            "length": "1.30",
            "height": "0.30"
          },
          "max_flight_time": "26 mins",
          "rc_frequency": "2.400GHz"
        }
      }
    }
    

    DELETE /fleet/drone-providers/{drone_provider_id}/drone-models/{drone_model_id}

    Delete a specific drone model of a specific drone provider belonging to the company of the user.

    Cameras

    You can track and manage your drone cameras using the Cameras API. Each camera is represented by a camera object wth the following properties:

    Property Type Description
    name String Name of the camera
    camera_id String Camera ID
    model Object Object representing the camera model. Contains the name of the model and the model_id
    notes String Descriptive notes for the camera
    acquired_on String Date that camera was acquired on, in epoch (Unix timestamp), converted to milliseconds

    Get all cameras

    Code samples

    require 'rest-client'
    require 'json'
    headers = {
      'Accept' => 'application/json'
    }
    result = RestClient.get 'https://api.garuda.io/v2/fleet/cameras',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/cameras', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/fleet/cameras' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/cameras',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "CAMERA-001",
          "camera_id": "0b53479856488f542a18fef96b84119d",
          "model": {
            "name": "Powershot S100",
            "model_id": "0e51493cd1ae85c097547de808642659"
          },
          "notes": "For front facing camera",
          "acquired_on": 1554090304172,
        },
        {
          "name": "CAMERA-002",
          "camera_id": "df0fb1aed5215106cf5bd23f8a005a55",
          "model": {
            "name": "Git2",
            "model_id": "f473a293f4294c6890f955fad4d10dc1"
          },
          "notes": "For downward facing camera",
          "acquired_on": 1554090304172,
        }
      ]
    }
    

    GET /fleet/cameras

    Get all cameras belonging to the company of the user. This endpoint returns an array of JSON objects, with each object representing a camera in the database.

    Create new camera

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/cameras',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/cameras', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/cameras' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "CAMERA-001",
          "model_id": "0e51493cd1ae85c097547de808642659",
          "notes": "For front facing camera"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "CAMERA-001",
      "model_id": "0e51493cd1ae85c097547de808642659",
      "notes": "For front facing camera"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/cameras',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "CAMERA-001",
        "camera_id": "0b53479856488f542a18fef96b84119d",
        "model": {
          "name": "Powershot S100",
          "model_id": "0e51493cd1ae85c097547de808642659"
        },
        "notes": "For front facing camera",
        "acquired_on": 1554090304172,
      }
    }
    

    POST /fleet/cameras

    Create a new camera belonging to the company of the user. At minimum, you should pass in the following details in the request body:

    Property Type Description
    name String Name of the camera
    model_id String Model ID of the camera

    model_id has to be a valid model ID that already exists in the database.

    There are some additional details that you can add to the request body to flesh out your camera details even further:

    Property Type Description
    notes String Descriptive notes for the camera
    acquired_on String Date that camera was acquired on, in epoch (Unix timestamp), converted to milliseconds

    If the acquired_on property is not specified, it will be saved as the time that the request was made.

    A camera that has been successfully created will return a response with a "success": true body and a 200 OK status.

    Get a camera

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/cameras/{camera_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/cameras/{camera_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/cameras/{camera_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/cameras/{camera_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "CAMERA-001",
        "camera_id": "0b53479856488f542a18fef96b84119d",
        "model": {
          "name": "Powershot S100",
          "model_id": "0e51493cd1ae85c097547de808642659"
        },
        "notes": "For front facing camera",
        "acquired_on": 1554090304172,
      }
    }
    

    GET /fleet/cameras/{camera_id}

    Get a specific camera belonging to the company of the user.

    camera_id parameter has to be a valid camera ID.

    Update a camera

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/cameras/{camera_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/cameras/{camera_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/cameras/{camera_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "notes": "For front facing camera, can also be used for downward facing"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "notes": "For front facing camera, can also be used for downward facing"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/cameras/{camera_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "CAMERA-001",
        "camera_id": "0b53479856488f542a18fef96b84119d",
        "model": {
          "name": "Powershot S100",
          "model_id": "0e51493cd1ae85c097547de808642659"
        },
        "notes": "For front facing camera, can also be used for downward facing",
        "acquired_on": 1554090304172,
      }
    }
    

    PATCH /fleet/cameras/{camera_id}

    Update a specific camera belonging to the company of the user.

    To update a specific camera, you can pass whichever properties that you wish to update in the request body. All properties are optional.

    Property Type Description
    name String Name of the camera
    camera_id String Camera ID
    model Object Object representing the camera model. Contains the name of the model and the model_id
    notes String Descriptive notes for the camera
    acquired_on String Date that camera was acquired on, in epoch (Unix timestamp), converted to milliseconds

    A camera that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated camera object.

    Delete a camera

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/cameras/{camera_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/cameras/{camera_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/cameras/{camera_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/cameras/{camera_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "CAMERA-001",
        "camera_id": "0b53479856488f542a18fef96b84119d",
        "model": {
          "name": "Powershot S100",
          "model_id": "0e51493cd1ae85c097547de808642659"
        },
        "notes": "For front facing camera",
        "acquired_on": 1554090304172,
      }
    }
    

    DELETE /fleet/cameras/{camera_id}

    Delete a specific camera belonging to the company of the user. A valid camera_id in the path parameter is required for a successful call.

    A successful deletion will return a 200 OK status and the deleted camera object in the response body.

    Camera Providers

    Camera providers are companies/brands that supply cameras to consumers. The Fleet APIs allow you to manage your company's camera providers, with each camera_provider object having the following properties:

    Property Type Description
    name String Name of the camera provider
    camera_provider_id String A unique camera provider ID
    brand String Brand name of the camera provider
    country String Country of origin of camera provider

    Get all camera providers

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/camera-providers',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/camera-providers', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/camera-providers' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "GoPro, Inc.",
          "camera_provider_id": "6811b8e899b9e7207775390d9664181b",
          "brand": "GoPro",
          "country": "USA"
        }
      ]
    }
    

    GET /fleet/camera-providers

    Get all cameras providers belonging to the company of the user. The response returns an array of all the camera_provider objects that belong to your company.

    Create new camera provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/camera-providers',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/camera-providers', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/cameras-providers' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "GoPro, Inc.",
          "brand": "GoPro",
          "country": "USA"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "GoPro, Inc.",
      "brand": "GoPro",
      "country": "USA"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "GoPro, Inc.",
        "camera_provider_id": "6811b8e899b9e7207775390d9664181b",
        "brand": "GoPro",
        "country": "USA"
      }
    }
    

    POST /fleet/camera-providers

    Create a new camera provider belonging to the company of the user. For this POST method, all the following fields are required in the request body for a successful call:

    Property Type Description
    name String Name of the camera provider
    brand String Brand name of the camera provider
    country String Country of origin of camera provider

    A camera provider that has been successfully created will return a response with a "success": true body and a 200 OK status.

    Get a camera provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/cameras-providers/{camera_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "GoPro, Inc.",
        "camera_provider_id": "6811b8e899b9e7207775390d9664181b",
        "brand": "GoPro",
        "country": "USA"
      }
    }
    

    GET /fleet/camera-providers/{camera_provider_id}

    Get a specific camera provider belonging the company of the user.

    Update a camera provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/cameras-providers/{camera_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "brand": "GoPro (Singapore)",
          "country": "Singapore"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "brand": "GoPro (Singapore)",
      "country": "Singapore"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "GoPro, Inc.",
        "camera_provider_id": "6811b8e899b9e7207775390d9664181b",
        "brand": "GoPro (Singapore)",
        "country": "Singapore"
      }
    }
    

    PATCH /fleet/camera-providers/{camera_provider_id}

    Update a specific camera provider belonging the company of the user. For this endpoint, all the fields are optional:

    Property Type Description
    name String Name of the camera provider
    brand String Brand name of the camera provider
    country String Country of origin of camera provider

    A camera provider that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated camera_provider object.

    Delete a camera provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/cameras-providers/{camera_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "GoPro, Inc.",
        "camera_provider_id": "6811b8e899b9e7207775390d9664181b",
        "brand": "GoPro",
        "country": "USA"
      }
    }
    

    DELETE /fleet/camera-providers/{camera_provider_id}

    Delete a specific camera provider belonging to the company of the user. A valid camera_provider_id in the path parameter is required for a successful call.

    A successful deletion will return a 200 OK status and the deleted camera_provider object in the response body.

    Camera Models

    Fleet APIs allow you to manage camera models. Each camera_model object contains information regarding a specific camera model provided by a camera provider. A camera_model object has the following properties:

    Property Type Description
    name String Name of the camera model
    model_id String Camera model ID
    provider Object Object representing the camera provider. Contains the name of the provider and the provider_id
    weight String Weight of the camera in kilograms (kg)
    type Array Array of enumerated strings describing the type of the camera. (see below)
    properties Object Object representing the properties of this camera model. (see below)

    Each camera_model should be of one or both of 2 types, and this is specified under the type property of the camera_model object. The enumerations available for type are:

    Type
    RGB, NDVI

    Each camera_model has a set of properties that describes the specifications of the camera model. The properties in the camera_model is an object with the following properties:

    Property Type Description
    sensor_size String sensor_size
    image_modes Array Array of strings of image_modes
    video_modes Array Array of strings of video_modes
    maximum_clip_length String maximum_clip_length
    image_file_formats Array Array of strings of supported image file formats
    video_file_formats Array Array of strings of supported video file formats
    lens_focal_length String lens_focal_length
    lens_focal_length_35mm_equiv String lens_focal_length_35mm_equiv
    optical_zoom String optical_zoom
    digital_zoom String digital_zoom
    aperture String aperture
    image_stabilization String image_stabilization
    auto_focus String auto_focus
    manual_focus Boolean Whether manual focus mode is supported
    af_modes Array Array of strings of supported AF Modes
    af_lock Boolean Whether AF lock is on
    af_assist_lamp Boolean Whether AF assist lamp is on
    focus_distance String focus_distance
    metering Array Array of strings describing the metering
    max_iso String max_iso
    shutter_speed String shutter_speed
    modes Array Array of strings describing the camera modes
    white_balance Array Array of strings of white balance modes(?)
    continuous_shooting String continuous_shooting
    connectivity Array Array of strings of supported connections
    storage Array Array of strings of supported storage
    power String power
    dimensions Object Object representing dimensions of camera. Properties are width, length, height

    Get all camera models

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "Powershot S100",
          "model_id": "0e51493cd1ae85c097547de808642659",
          "provider": {
            "name": "Canon Inc.",
            "provider_id": "2db274b2709ce1ce89457057d6e9fd3b"
          },
          "type": [
            "RGB", 
            "NDIV"
          ]
        }
      ]
    }
    

    GET /fleet/camera-providers/{camera_provider_id}/camera-models

    When getting all camera_models belonging to a specific camera provider in your company, you have to provide a valid and existing camera_provider_id. The HTTP response body will contain an array of camera_model objects belonging to your specified camera_provider.

    You can specify the extent of which to fetch the data via query strings:

    Query Default Values Description
    options shallow shallow, deep Specify if data retrieved should be a deep or shallow fetch

    For a shallow fetch (which is the default behaviour), only the name, model_id, provider, and type will be retrieved (see sample response on the left for how this will look like). A deep fetch will retrieve more information for each of the objects -- to see the exact properties that will be retrieved with a deep fetch, refer to the beginning of this section.

    Create new camera model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "Powershot S100",
          "provider_id": "2db274b2709ce1ce89457057d6e9fd3b"
          "type": [
            "RGB", 
            "NDIV"
          ]
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "Powershot S100",
      "provider_id": "2db274b2709ce1ce89457057d6e9fd3b"
      "type": [
        "RGB", 
        "NDIV"
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Powershot S100",
        "model_id": "0e51493cd1ae85c097547de808642659",
        "provider": {
          "name": "Canon Inc.",
          "provider_id": "2db274b2709ce1ce89457057d6e9fd3b"
        },
        "type": [
          "RGB", 
          "NDIV"
        ]
      }
    }
    

    POST /fleet/camera-providers/{camera_provider_id}/camera-models

    Every created camera_model has to belong to a valid and existing camera_provider. When calling this API, the camera_provider_id parameter has to be valid for a successful call.

    When creating a new camera_model, at minimum, you should pass in values for the following properties:

    Property Type Description
    name String Name of the camera model
    provider_id String Camera provider ID
    type Array Array of enumerated strings describing the type of the camera.

    For more information on these properties, refer to the camera_model object description at the beginning of this section

    You can also choose to pass in more information on the camera model to flesh out the rest of the object:

    Property Type Description
    weight String Weight of the camera in kilograms (kg)
    properties Object Object representing the properties of this camera model. (see below)

    Otherwise, these properties can also be added at a later time with the PATCH endpoint.

    Update a camera model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "weight": "0.198",
          "properties": {
            "video_modes": [
              "1920 x 1080 @ 24 fps",
              "1280 x 720 @ 30fps"
            ],
            "video_file_formats": [
              "H.264"
            ]
          }
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "weight": "0.198",
      "properties": {
        "video_modes": [
          "1920 x 1080 @ 24 fps",
          "1280 x 720 @ 30fps"
        ],
        "video_file_formats": [
          "H.264"
        ]
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Powershot S100",
        "model_id": "0e51493cd1ae85c097547de808642659",
        "provider": {
          "name": "Canon Inc.",
          "provider_id": "2db274b2709ce1ce89457057d6e9fd3b"
        },
        "type": [
          "RGB", 
          "NDIV"
        ],
        "weight": "0.198",
        "properties": {
          "video_modes": [
            "1920 x 1080 @ 24 fps",
            "1280 x 720 @ 30fps"
          ],
          "video_file_formats": [
            "H.264"
          ]
        }
      }
    }
    

    PATCH /fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}

    This endpoint allows you to edit and update information regarding a camera_model that has already been created. For the request body of this endpoint, it is not necessary to pass in values for all the properties of a camera_model. All of the following properties are optional:

    Property Type Description
    name String Name of the camera model
    model_id String Camera model ID
    provider Object Object representing the camera provider. Contains the name of the provider and the provider_id
    weight String Weight of the camera in kilograms (kg)
    type Array Array of enumerated strings describing the type of the camera. (see below)
    properties Object Object representing the properties of this camera model. (see below)

    For more information on these properties, refer to the camera_model object description at the beginning of this section

    A camera_model that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated camera_model object.

    Delete a camera model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Powershot S100",
        "model_id": "0e51493cd1ae85c097547de808642659",
        "provider": {
          "name": "Canon Inc.",
          "provider_id": "2db274b2709ce1ce89457057d6e9fd3b"
        },
        "type": [
          "RGB", 
          "NDIV"
        ]
      }
    }
    

    DELETE /fleet/camera-providers/{camera_provider_id}/camera-models/{camera_model_id}

    Delete a specific camera model of a specific camera provider belonging to the company of the user.

    Batteries

    You can track and manage your drone batteries using the batteries API. Each battery is represented by a battery object wth the following properties:

    Property Type Description
    name String Name of the battery
    battery_id String Battery ID
    model Object Object representing the battery model. Contains the name of the model and the model_id
    notes String Descriptive notes for the battery
    acquired_on String Date that battery was acquired on, in epoch (Unix timestamp), converted to milliseconds
    shared Boolean Boolean representing battery's shared status. (insert what shared means here)

    Get all batteries

    Code samples

    require 'rest-client'
    require 'json'
    headers = {
      'Accept' => 'application/json'
    }
    result = RestClient.get 'https://api.garuda.io/v2/fleet/batteries',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/batteries', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/fleet/batteries' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/batteries',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "BATTERY-001",
          "model": {
            "name": "Multistar 6S 6600",
            "model_id": "4b38b7383fdb23fbff8c3a6a694e4533"
          },
          "notes": "This battery is meant for small drones only.",
          "shared": false,
          "acquired_on": 1554090304172
        }
      ]
    }
    

    GET /fleet/batteries

    Get all batteries belonging to the company of the user. This endpoint returns an array of JSON objects, with each object representing a battery in the database.

    Create new battery

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/batteries',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/batteries', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/batteries' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "BATTERY-001",
          "model_id": "4b38b7383fdb23fbff8c3a6a694e4533",
          "notes": "This battery is meant for small drones only."
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "BATTERY-001",
      "model_id": "4b38b7383fdb23fbff8c3a6a694e4533",
      "notes": "This battery is meant for small drones only."
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/batteries',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "BATTERY-001",
        "model": {
          "name": "Multistar 6S 6600",
          "model_id": "4b38b7383fdb23fbff8c3a6a694e4533"
        },
        "notes": "This battery is meant for small drones only.",
        "shared": false,
        "acquired_on": 1554090304172
      }
    }
    

    POST /fleet/batteries

    Create a new battery belonging to the company of the user. At minimum, you should pass in the following details in the request body:

    Property Type Description
    name String Name of the battery
    model_id String Model ID of the battery

    model_id has to be a valid model ID that already exists in the database.

    There are some additional details that you can add to the request body to flesh out your battery details even further:

    Property Type Description
    notes String Descriptive notes for the battery
    acquired_on String Date that battery was acquired on, in epoch (Unix timestamp), converted to milliseconds
    shared Boolean Boolean representing battery's shared status. (insert what shared means here)

    If the acquired_on property is not specified, it will be saved as the time that the request was made.

    If the shared property is not specified, the default value is false.

    A battery that has been successfully created will return a response with a "success": true body and a 200 OK status.

    Get a battery

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/batteries/{battery_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/batteries/{battery_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/batteries/{battery_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/batteries/{battery_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "BATTERY-001",
        "model": {
          "name": "Multistar 6S 6600",
          "model_id": "4b38b7383fdb23fbff8c3a6a694e4533"
        },
        "notes": "This battery is meant for small drones only.",
        "shared": false,
        "acquired_on": 1554090304172
      }
    }
    

    GET /fleet/batteries/{battery_id}

    Get a specific battery belonging to the company of the user.

    battery_id parameter has to be a valid battery ID.

    Update a battery

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/batteries/{battery_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/batteries/{battery_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/batteries/{battery_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "notes": "Can be used for both small and large drones"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "notes": "Can be used for both small and large drones"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/batteries/{battery_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "BATTERY-001",
        "model": {
          "name": "Multistar 6S 6600",
          "model_id": "4b38b7383fdb23fbff8c3a6a694e4533"
        },
        "notes": "Can be used for both small and large drones",
        "shared": false,
        "acquired_on": 1554090304172
      }
    }
    

    PATCH /fleet/batteries/{battery_id}

    Update a specific battery belonging to the company of the user.

    To update a specific battery, you can pass whichever properties that you wish to update in the request body. All properties are optional.

    Property Type Description
    name String Name of the battery
    battery_id String battery ID
    model Object Object representing the battery model. Contains the name of the model and the model_id
    notes String Descriptive notes for the battery
    acquired_on String Date that battery was acquired on, in epoch (Unix timestamp), converted to milliseconds

    A battery that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated battery object.

    Delete a battery

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/batteries/{battery_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/batteries/{battery_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/batteries/{battery_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/batteries/{battery_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "BATTERY-001",
        "model": {
          "name": "Multistar 6S 6600",
          "model_id": "4b38b7383fdb23fbff8c3a6a694e4533"
        },
        "notes": "This battery is meant for small drones only.",
        "shared": false,
        "acquired_on": 1554090304172
      }
    }
    

    DELETE /fleet/batteries/{battery_id}

    Delete a specific battery belonging to the company of the user. A valid battery_id in the path parameter is required for a successful call.

    A successful deletion will return a 200 OK status and the deleted battery object in the response body.

    Battery Providers

    Battery providers are companies/brands that supply batteries to consumers. The Fleet APIs allow you to manage your company's battery providers, with each battery_provider object having the following properties:

    Property Type Description
    name String Name of the battery provider
    battery_provider_id String A unique battery provider ID
    brand String Brand name of the battery provider
    country String Country of origin of battery provider

    Get all battery providers

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/battery-providers',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/battery-providers', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/battery-providers' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "Da-Jiang Innovations Science and Technology Co., Ltd",
          "battery_provider_id": "1c9e81a9a3352cd010857331acd63a92",
          "brand": "DJI",
          "country": "China"
        }
      ]
    }
    

    GET /fleet/battery-providers

    Get all batteries providers belonging to the company of the user. The response returns an array of all the battery_provider objects that belong to your company.

    Create new battery provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/battery-providers',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/battery-providers', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/batteries-providers' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "Da-Jiang Innovations Science and Technology Co., Ltd",
          "brand": "DJI",
          "country": "China"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
     "name": "Da-Jiang Innovations Science and Technology Co., Ltd",
      "brand": "DJI",
      "country": "China"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Da-Jiang Innovations Science and Technology Co., Ltd",
        "battery_provider_id": "1c9e81a9a3352cd010857331acd63a92",
        "brand": "DJI",
        "country": "China"
      }
    }
    

    POST /fleet/battery-providers

    Create a new battery provider belonging to the company of the user. For this POST method, all the following fields are required in the request body for a successful call:

    Property Type Description
    name String Name of the battery provider
    brand String Brand name of the battery provider
    country String Country of origin of battery provider

    A battery provider that has been successfully created will return a response with a "success": true body and a 200 OK status.

    Get a battery provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/batteries-providers/{battery_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Da-Jiang Innovations Science and Technology Co., Ltd",
        "battery_provider_id": "1c9e81a9a3352cd010857331acd63a92",
        "brand": "DJI",
        "country": "China"
      }
    }
    

    GET /fleet/battery-providers/{battery_provider_id}

    Get a specific battery provider belonging the company of the user.

    Update a battery provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/batteries-providers/{battery_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "brand": "DJI - China"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "brand": "DJI - China"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Da-Jiang Innovations Science and Technology Co., Ltd",
        "battery_provider_id": "1c9e81a9a3352cd010857331acd63a92",
        "brand": "DJI - China",
        "country": "China"
      }
    }
    

    PATCH /fleet/battery-providers/{battery_provider_id}

    Update a specific battery provider belonging the company of the user. For this endpoint, all the fields are optional:

    Property Type Description
    name String Name of the battery provider
    brand String Brand name of the battery provider
    country String Country of origin of battery provider

    A battery provider that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated battery_provider object.

    Delete a battery provider

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/batteries-providers/{battery_provider_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Da-Jiang Innovations Science and Technology Co., Ltd",
        "battery_provider_id": "1c9e81a9a3352cd010857331acd63a92",
        "brand": "DJI",
        "country": "China"
      }
    }
    

    DELETE /fleet/battery-providers/{battery_provider_id}

    Delete a specific battery provider belonging to the company of the user. A valid battery_provider_id in the path parameter is required for a successful call.

    A successful deletion will return a 200 OK status and the deleted battery_provider object in the response body.

    Battery Models

    Fleet APIs allow you to manage battery models. Each battery_model object contains information regarding a specific battery model provided by a battery provider. A battery_model object has the following properties:

    Property Type Description
    name String Name of the battery model
    model_id String Battery model ID
    provider Object Object representing the battery provider. Contains the name of the provider and the provider_id
    chemistry String The chemistry composition of the battery
    series String Enumerated string description of the series settings of the battery
    parallel String Enumerated string description of the parallel settings of the battery
    capacity String Capacity of the battery in milliamp-hours (mAh)
    weight String Weight of the battery in kilograms (kg)
    discharge_rate String String description of the discharge rate of the battery
    dimensions Object Dimensions of drone. Object has the properties width, length, and height (m)

    The series and parallel characteristic of the battery will only accept pre-defined enumerations. They are listed as follows:

    Series
    1S, 2S, 3S, 4S, 5S, 6S, 7S, 8S, 9S, 10S, 11S, 12S
    Parallel
    1P, 2P, 3P, 4P

    Get all battery models

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X GET 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": [
        {
          "name": "Multistar 6S 6600",
          "model_id": "4b38b7383fdb23fbff8c3a6a694e4533",
          "provider": {
            "name": "DJI",
            "provider_id": "1c9e81a9a3352cd010857331acd63a92"
          },
          "chemistry": "LiPo",
          "series": "6",
          "parallel": "1",
          "capacity": "6600"
        }
      ]
    }
    

    GET /fleet/battery-providers/{battery_provider_id}/battery-models

    When getting all battery_models belonging to a specific battery provider in your company, you have to provide a valid and existing battery_provider_id. The HTTP response body will contain an array of battery_model objects belonging to your specified battery_provider.

    You can specify the extent of which to fetch the data via query strings:

    Query Default Values Description
    options shallow shallow, deep Specify if data retrieved should be a deep or shallow fetch

    For a shallow fetch (which is the default behaviour), only the name, model_id, provider, chemistry, series, parallel, and capacity will be retrieved (see sample response on the left for how this will look like). A deep fetch will retrieve more information for each of the objects -- to see the exact properties that will be retrieved with a deep fetch, refer to the beginning of this section.

    Create new battery model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "name": "Multistar 6S 6600",
          "provider_id": "1c9e81a9a3352cd010857331acd63a92",
          "chemistry": "LiPo",
          "series": "6",
          "parallel": "1",
          "capacity": "6600"
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "name": "Multistar 6S 6600",
      "provider_id": "1c9e81a9a3352cd010857331acd63a92",
      "chemistry": "LiPo",
      "series": "6",
      "parallel": "1",
      "capacity": "6600"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Multistar 6S 6600",
        "model_id": "4b38b7383fdb23fbff8c3a6a694e4533",
        "provider": {
          "name": "DJI",
          "provider_id": "1c9e81a9a3352cd010857331acd63a92"
        },
        "chemistry": "LiPo",
        "series": "6",
        "parallel": "1",
        "capacity": "6600"
      }
    }
    

    POST /fleet/battery-providers/{battery_provider_id}/battery-models

    Every created battery_model has to belong to a valid and existing battery_provider. When calling this API, the battery_provider_id parameter has to be valid for a successful call.

    When creating a new battery_model, at minimum, you should pass in values for the following properties:

    Property Type Description
    name String Name of the battery model
    provider_id String Battery provider ID
    chemistry String The chemistry composition of the battery
    series String Enumerated string description of the series settings of the battery
    parallel String Enumerated string description of the parallel settings of the battery
    capacity String Capacity of the battery in milliamp-hours (mAh)

    For more information on these properties, refer to the battery_model object description at the beginning of this section

    You can also choose to pass in more information on the battery model to flesh out the rest of the object:

    Property Type Description
    weight String Weight of the battery in kilograms (kg)
    discharge_rate String String description of the discharge rate of the battery
    dimensions Object Dimensions of drone. Object has the properties width, length, and height (m)

    Otherwise, these properties can also be added at a later time with the PATCH endpoint.

    Update a battery model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.patch 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.patch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X PATCH 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "dimensions": {
            "width": "0.056",
            "length": "0.0145",
            "height": "0.052"
          }
         }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "dimensions": {
        "width": "0.056",
        "length": "0.0145",
        "height": "0.052"
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Multistar 6S 6600",
        "model_id": "4b38b7383fdb23fbff8c3a6a694e4533",
        "provider": {
          "name": "DJI",
          "provider_id": "1c9e81a9a3352cd010857331acd63a92"
        },
        "chemistry": "LiPo",
        "series": "6",
        "parallel": "1",
        "capacity": "6600",
        "dimensions": {
          "width": "0.056",
          "length": "0.0145",
          "height": "0.052"
        }
      }
    }
    

    PATCH /fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}

    This endpoint allows you to edit and update information regarding a battery_model that has already been created. For the request body of this endpoint, it is not necessary to pass in values for all the properties of a battery_model. All of the following properties are optional:

    Property Type Description
    name String Name of the battery model
    model_id String Battery model ID
    provider Object Object representing the battery provider. Contains the name of the provider and the provider_id
    chemistry String The chemistry composition of the battery
    series String Enumerated string description of the series settings of the battery
    parallel String Enumerated string description of the parallel settings of the battery
    capacity String Capacity of the battery in milliamp-hours (mAh)
    weight String Weight of the battery in kilograms (kg)
    discharge_rate String String description of the discharge rate of the battery
    dimensions Object Dimensions of drone. Object has the properties width, length, and height (m)

    For more information on these properties, refer to the battery_model object description at the beginning of this section

    A battery_model that has been successfully updated will return a response with a "success": true body and a 200 OK status. Response body will also contain the updated battery_model object.

    Delete a battery model

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.delete 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.delete('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X DELETE 'https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "name": "Multistar 6S 6600",
        "model_id": "4b38b7383fdb23fbff8c3a6a694e4533",
        "provider": {
          "name": "DJI",
          "provider_id": "1c9e81a9a3352cd010857331acd63a92"
        },
        "chemistry": "LiPo",
        "series": "6",
        "parallel": "1",
        "capacity": "6600"
      }
    }
    

    DELETE /fleet/battery-providers/{battery_provider_id}/battery-models/{battery_model_id}

    Delete a specific battery model of a specific battery provider belonging to the company of the user.

    Live Flight API

    Garuda Plex Live Flight APIs allow you to communicate and receive information regarding your drone in live flight, and issue commands to the drone while in live flight.

    Drone Management

    During a live drone flight, there are a multitude of information that you can retrieve about your drone to understand it's health, status and other diagnostics information.

    Drone Management APIs allow you to query such information directly from the drone to provide you with the most up-to-date and accurate information as quickly as possible.

    Get all drones and live status

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/drones',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/drones', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/drones' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/drones',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    

    200 Response

    {
      "success": true,
      "data": {
        "count": 1,
        "drones": [
          {
            "id": "9d0330b429354a07ba7928aa6289c34c",
            "status": "online",
            "telemetry_uri": "wss://api.garuda.io/telemetry/live/web?drone_id=9d0330b429354a07ba7928aa6289c34c&api_key=your_api_key",
            "stream_uris": [
              {
                "id": "03725f1054e54ce4bda92e8b3ec34edf",
                "uri": "rtmp://skystream.garuda.io/SkyStream/9d0330b429354a07ba7928aa6289c34c-03725f1054e54ce4bda92e8b3ec34edf",
                "name": "payload camera 1"
              }
            ]
          }
        ]
      }
    }
    

    GET /drones

    With the first endpoint, you can retrieve information regarding all your drones in the system, along with the id of the drone, its connectivity status, telemetry URIs and video stream URIs. With the URIs provided, you will be able to retrieve the raw telemetry data from the drone and also view the live stream of the camera(s) on the drone.

    Telemetry is delivered via a web socket connection. To learn more about telemetry and how you can create a client to read and receive telemetry via a web socket, refer to Getting live telemetry

    Live video streams are delivered either via rtmp or rtsp protocols. To learn more about live video streams and the available protocols to retrieve the streams, refer to Video

    Get latest telemetry data

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/telemetry/{drone_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/telemetry/{drone_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/telemetry/{drone_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/telemetry/{drone_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    

    200 Response

    {
      "success": true,
      "data": {
        "droneId": "4e63faa7eb83cb0f3dfc498c5020a35e",
        "timestamp": "1560495518277",
        "lat": "30.30516",
        "long": "-214.74836",
        "alt": "100.00",
        "yaw": "-6.94",
        "pitch": "0.00",
        "roll": "0.00",
        "agl": "100.00",
        "flightState": "init",
        "failsafe": "None",
        "flightTime": "3600000",
        "velocity_x": "10.00",
        "velocity_y": "10.00",
        "velocity_z": "10.00",
        "battVolt": "12587.00",
        "battCurr": "12587.00",
        "battLife": "100.00",
        "satCount": "10",
        "gpsHAcc": "121",
        "gpsVAcc": "65535",
        "homeLat": "30.305168",
        "homeLong": "-214.7483648",
        "homeAlt": "None",
        "rssi": "123.123",
        "network_name": "Singtel"
      }
    }
    

    GET /telemetry/{drone_id}

    This endpoint allows you to query for the single latest telemetry data, just to get the latest update on the status and location of your drone. To learn more about telemetry and the information you will be able to obtain via each telemetry, refer to Telemetry.

    Get information on a specific drone

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/drones/{drone_id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/drones/{drone_id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/drones/{drone_id}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/drones/{drone_id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "8b594775-abe8-4409-9ce3-b298da488dee",
        "model": "Phantom 3 Professional",
        "brand": "DJI",
        "category": "Quadcopter",
        "totalFlights": 0,
        "totalAirtime": ""
      }
    }
    

    GET /drones/{drone_id}

    You can retrieve detailed information on a specific drone with this call. Each response will contain the following information:

    Property Type Description
    id String Drone ID
    model String Model name of the drone
    brand String Brand name of the drone
    category Object Category of drone
    totalFlights Number Total number of flights of drone
    totalAirtime String Number of hours drone has flown (in nearest minute, up to two decimal places)

    Telemetry

    A drone telemetry consists of simple data and relevant information about your drone flight, including the location (lat, long), altitude, position, speed, power consumption, system and battery information of your drone. Usually recorded and logged either in real-time or post-flight, telemetry of your flight gives you vital information about the condition of your drone, what it is doing, it's surroundings at each point of the flight, and more.

    Garuda Plex Telemetry APIs allow you to submit and receive telemetry. This is done via web socket connections.

    telemetry_diagram

    The diagram (on the right) and explanation below briefly details how telemetry (and other diagnostics from the drone) is passed from the drone (or your servers) in live flight to our servers and then back down to consumers/users like yourself.

    1. During a live flight, you can submit telemetry data via Garuda Plex Telemetry APIs using a web socket connection. This can be done either from the drone directly (if your drone supports it), or via your own service(s) that can support web socket connections.
    2. These telemetry data will be pushed into our database servers, and also a telemetry web service we are running that exposes a web socket to allow users to consume the same data as well.
    3. This data can then be displayed on either a frontend of your choice, or simply logged to your own servers.

    Each of these telemetry object is a JSON object that has the following format and properties:

    {
      "droneId": "4e63faa7eb83cb0f3dfc498c5020a35e",
      "timestamp": "1560495518277",
      "lat": "30.30516",
      "long": "-214.74836",
      "alt": "100.00",
      "yaw": "-6.94",
      "pitch": "0.00",
      "roll": "0.00",
      "agl": "100.00",
      "flightState": "init",
      "failsafe": "None",
      "flightTime": "3600000",
      "velocity_x": "10.00",
      "velocity_y": "10.00",
      "velocity_z": "10.00",
      "battVolt": "12587.00",
      "battCurr": "12587.00",
      "battLife": "100.00",
      "satCount": "10",
      "gpsHAcc": "121",
      "gpsVAcc": "65535",
      "homeLat": "30.305168",
      "homeLong": "-214.7483648",
      "homeAlt": "None",
      "rssi": "123.123",
      "network_name": "Singtel"
    }
    
    Property Type Description
    droneId String Drone ID of this telemetry
    timestamp Number Timestamp of telemetry in epoch (Unix timestamp), converted to milliseconds
    lat Number Telemetry latitude, to 5 decimal places
    long Number Telemetry longitude, to 5 decimal places
    alt Number Altitude above mean sea level, in meters. (2 decimal places)
    agl String Altitude above ground level, in meters. (2 decimal places)
    yaw String Drone yaw degree (-180 deg to 180 deg)
    pitch String Drone pitch degree (-90 deg to 90 deg)
    roll String Drone roll degree (-180 deg to 180 deg)
    flightState String Enumerated string of flight states of the drone
    daaState Boolean Boolean to indicate if DAA has been activated
    failsafe String Current fail safe status if its activated
    flightTime String Flight time in milliseconds
    velocity_x Number Velocity in x-direction in meters per second, using the North-East-Down coordinate system
    velocity_y Number Velocity in y-direction in meters per second, using the North-East-Down coordinate system
    velocity_z Number Velocity in z-direction in meters per second, using the North-East-Down coordinate system
    battVolt String Battery voltage, in volts, up to 2 decimal places
    battCurr String Battery current output, in amperes, up to 2 decimal places
    battLife String battery charge remaining in percentage (0 - 100%)
    satCount String Number of GPD satellites that drone is connected to
    gpsHAcc String GPS Horizontal accuracy in metres measures up to micrometres
    gpsVAcc String GPS Vertical accuracy in metres measures up to micrometres
    homeLat String Latitude of home point
    homeLong String Longitude of home point
    homeAlt String Altitude of home point, in meters above mean sea level
    rssi String Received signal strength indicator on connected network (by percentage)
    network_name String Name of the connected network

    The flight states of the drone follows a state diagram and changes depending on at which state of the flight the drone is in:

    drone-state-diagram

    Flight States Description
    RTF Drone is ready to fly
    TAKE OFF When the command has been given to take off. NOTE: DJI does not have arm procedure whereas Mavlink has.
    HOLD When the drone is not moving in air
    AUTO When the drone is executing the current mission plan.
    GUIDED When the drone is in manual navigation, going to specific point, etc.
    LAND When the drone is landing.
    OG When the drone has landed (on ground).

    Submitting telemetry

    Garuda Plex APIs uses web sockets to receive telemetry from users. Given an access_token, drone_id and your company_id, you will be able to connect to the web socket and send live telemetry.

    wss://<URL>?access_token=<ACCESS_TOKEN>&companyId=<COMPANY_ID>&droneId=<DRONE_ID>
    

    This web socket will accept incoming messages that conforms to the telemetry JSON object defined above.

    There are many ways you can implement a server to send web socket messages. Listed below is a quick example using a Google Chrome extension and also an example with a NodeJS library and Javascript.

    With Google Chrome extension Simple WebSocket Client

    This is a lightweight extension for Google Chrome that gives you a very simple interface that allows you to establish a web socket connection as a client with a listening server, and send/receive message through the web socket.

    After installing the extension in Google Chrome, simply open up the extension, which will bring you to a new tab with the application UI.

    You should see that under Server Location, the STATUS should be CLOSED.

    With your access_token, drone_id and company_id entered as query parameters into the URL above, simply paste it into the URL textfield and click on Open.

    The STATUS should change to OPENED once the web socket connection has been successfully established, and you can start to send telemetry under the REQUEST section.

    With NodeJS and Javascript

    This example assumes you already have NodeJS installed on your machine

    Implementing a web socket client using Node and Javascript is also very simple and straightforward. The npm library websocket allows you to spin up a web socket client very quickly with minimal code.

    To install this library, cd into your Node project directory and run npm install websocket.

    Download the two sample files provided here to get started quickly. The first file is the source code for running the web socket client, while the second file provides some mock telemetry data (10 in total) for testing out this service.

    ws-send-telem.js

    mock-telemetry.js

    NOTE: Remeber to replace <ACCESS_TOKEN>, <DRONE_ID> and <COMPANY_ID> with the appropriate values.

    Lastly, run the project with node ws-send-telem.js and your client should be connected to the web socket server and sending telemetry defined in mock-telemetry.js. Each time you run the node program, a telemetry message will be sent every 1 second to our servers. Feel free to change the frequency of the telemetry or the total number of telemetry to be sent by editing the source files.

    Getting live telemetry

    After sending the telemetry, you will also be able to listen and retrieve this telemetry with another web socket client. Receiving telemetry is done on a company wide level.

    wss://<URL>?access_token=&company_id=
    

    With Google Chrome extension Simple WebSocket Client

    Instructions for the extension is similar to the sender above.

    With your access_token and company_id entered as query parameters into the URL above, simply paste it into the URL textfield and click on Open.

    The STATUS should change to OPENED once the web socket connection has been successfully established, and you should start to receive the telemetry data in raw JSON format in the message log console during your live flight.

    var WebSocketClient = require('websocket').client;
    
    var client = new WebSocketClient();
    
    client.on('connectFailed', function(error) {
        console.log('Connect Error: ' + error.toString());
    });
    
    client.on('connect', function(connection) {
        console.log('WebSocket Client Connected');
        connection.on('error', function(error) {
            console.log("Connection Error: " + error.toString());
        });
        connection.on('close', function() {
            console.log('echo-protocol Connection Closed');
        });
        connection.on('message', function(message) {
            if (message.type === 'utf8') {
                console.log("Received: '" + message.utf8Data + "'");
            }
        });
    
        function sendNumber() {
            if (connection.connected) {
                var number = Math.round(Math.random() * 0xFFFFFF);
                connection.sendUTF(number.toString());
                setTimeout(sendNumber, 1000);
            }
        }
        sendNumber();
    });
    
    client.connect('wss://<URL>?access_token=<ACCESS_TOKEN>&company_id=<COMPANY_ID>', 'echo-protocol');
    

    With NodeJS and Javascript

    This example assumes you already have NodeJS installed on your machine

    We will use the same npm library, websocket, to implement the receiver for the telemetry.

    Next, create a file ws-receive-telem.js and paste the provided example code on the right into it. Remeber to replace <ACCESS_TOKEN> and <COMPANY_ID> with the appropriate values. NOTE: Select the javascript tab at the top of the code section if you don't see the example code!

    Alternatively, you can download the file directly: ws-receive-telem.js

    Run the project with node ws-receive-telem.js and your client should be connected to the web socket server and listening for telemetry. Once your drone is in active flight and telemetry is being logged, you should see the telemetry JSON objects printed out on the console.

    Command and Control

    Command and Control APIs allow you to issue various live commands to your drone using HTTP requests. Each of these commands, once submitted to the drone, will be logged in a drone command log under a specified commandLogId. This commandLogId will be returned as a response for each command that has been issued to the drone, and can be used to query for the status of the command via the Admin APIs.

    Response for each command sent

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    The response for each command sent to the drone will contain the following information:

    Property Type Description
    id String Command log ID
    createdBy String ID of user that sent the command
    createdDate String Date-time of command sent, in ISO 8601 format

    Take off

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/takeOff',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/takeOff', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/takeOff' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "altitude": "string"
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "altitude": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/takeOff',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/takeOff

    Command drone to take-off. Drone will arm and take off.

    A valid drone_id is required as a URL parameter for a successful command.

    You should pass in the following details in the request body:

    Property Type Description
    altitude String Target Altitude in metres measures to nearest centimetres where drone will take off relative to home position

    Move

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/move',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/move', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/move' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "forward": "string",
          "left": "string",
          "down": "string"
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "forward": "string",
      "left": "string",
      "down": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/move',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/move

    Manually command drone to move based on relative location

    A valid drone_id is required as a URL parameter for a successful command.

    You should pass in the following details in the request body:

    Property Type Description
    forward String Distance for done to travel forward in metres measures in neasrest centimetres. If negative values provided, drone will travel backwards
    left String Distance for drone to travel left in metres measured in nearest centimetres. If negative values is provided, drone will travel right.
    down String Distance for drone to descend in metres measured in nearest centimetres. If positive values is provided, drone will ascend.

    Yaw

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/yaw',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/yaw', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/yaw' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "direction": "clockwise",
          "speed": "string",
          "degree": "string",
          "relative": false
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "direction": "clockwise",
      "speed": "string",
      "degree": "string",
      "relative": false
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/yaw',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/yaw

    Command drone to yaw based on given properties.

    A valid drone_id is required as a URL parameter for a successful command.

    You should pass in the following details in the request body:

    Property Type Description
    direction String Direction for Drone to yaw: clockwise or anticlockwise
    speed String Speed of drone to rotate in degree per second measures up to two decimal places
    degree String Degree measures up to two decimal places. If relative is true, degree will be amount that drone will yaw to. If relative is false, degree is the target that drone will yaw to where 0 is north. Minimum: 0, Maximum: 360
    relative Boolean If true, drone will yaw , if false, drone will yaw by degree amount, where 0 is north regardless of drone currently pointing to

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/navigate',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/navigate', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/navigate' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "latitude": "string",
          "longitude": "string",
          "altitude": "string"
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "latitude": "string",
      "longitude": "string",
      "altitude": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/navigate',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/navigate

    Command drone to navigate to a target GPS coordinate. Drone will travel to target coordinate autonomously in straight line.

    A valid drone_id is required as a URL parameter for a successful command.

    You should pass in the following details in the request body:

    Property Type Description
    latitude String Latitude of target coordinate in decimal degrees according to WGS84
    longitude String Longitude of target coordinate in decimal degrees according to WGS84
    altitude String Altitude of target coordinate in metres above mean sea level (MAMSL) measures to nearest centimetres, if null, drone will maintain at current altitude

    Follow

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/follow',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/follow', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/follow' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "coordinateX": 0,
          "coordinateY": 0
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "coordinateX": 0,
      "coordinateY": 0
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/follow',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/follow

    Command drone to follow target. Drone will identify subject specified in target point and autonomously follow target.

    A valid drone_id is required as a URL parameter for a successful command.

    You should pass in the following details in the request body:

    Property Type Description
    coordinateX String X Coordinate of target to be followed from camera feed
    coordinateY String Y Coordinate of target to be followed from camera feed

    Hold

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/hold',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/hold', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/hold' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/hold',
    {
      method: 'POST',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/hold

    Command drone to hold at current position

    A valid drone_id is required as a URL parameter for a successful command.

    Return to home

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/returnToHome',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/returnToHome', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/returnToHome' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/returnToHome',
    {
      method: 'POST',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/returnToHome

    Command drone to return to home position. Drone will navigate to home position and land.

    A valid drone_id is required as a URL parameter for a successful command.

    Land

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/land',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/land', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/land' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/land',
    {
      method: 'POST',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "73abd1c02a1046bd358c54728e5b6156",
        "createdBy": "5bb1ef3af490e4e49ad5b369e8b6991f",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/land

    Command drone to land at current GPS coordinate immediately to ground. When landed, drone will unarm.

    A valid drone_id is required as a URL parameter for a successful command.

    Admin (Live)

    Admin API for troubleshooting and advanced configuration

    Get command log status

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/droneCommandLog/{commandLogId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/droneCommandLog/{commandLogId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/droneCommandLog/{commandLogId}' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/droneCommandLog/{commandLogId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "string",
        "createdBy": "string",
        "createdDate": "2019-07-10T03:02:30.705Z"
      }
    }
    

    GET /droneCommandLog/{commandLogId}

    Get status of a command log, for troubleshooting purpose

    A valid commandLogId is required as a URL parameter for a successful command.

    Set return to home altitude

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/setReturnHomeAltitude',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/setReturnHomeAltitude', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/setReturnHomeAltitude' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "altitude": "string"
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "altitude": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/setReturnHomeAltitude',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "string",
        "createdBy": "string",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/setReturnHomeAltitude

    Set altitude that drone will ascend or descend to when performing return to home command.

    A valid drone_id is required as a URL parameter for a successful command.

    You should pass in the following details in the request body:

    Property Type Description
    altitude String Target Altitude in metres measures to nearest centimetres where drone will take off relative to home position

    Set drone home position

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/setHomePosition',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/setHomePosition', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/setHomePosition' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "latitude": "string",
          "longitude": "string",
          "altitude": 0
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "latitude": "string",
      "longitude": "string",
      "altitude": 0
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/setHomePosition',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "string",
        "createdBy": "string",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/setHomePosition

    Set Home Position for Drone, this will affect return to home command. If drone is returning to home, this action will change the destination for drone to return to.

    A valid drone_id is required as a URL parameter for a successful command.

    You should pass in the following details in the request body:

    Property Type Description
    latitude String Latitude of target coordinate in decimal degrees according to WGS84
    longitude String Longitude of target coordinate in decimal degrees according to WGS84
    altitude String Altitude of target coordinate in metres above mean sea level (MAMSL) measures to nearest centimetres, if null, drone will maintain at current altitude

    Set camera pitch angle

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.garuda.io/v2/command/drone/{drone_id}/setCameraPitch',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.garuda.io/v2/command/drone/{drone_id}/setCameraPitch', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    curl -X POST 'https://api.garuda.io/v2/command/drone/{drone_id}/setCameraPitch' \
         -H 'Authorization: Bearer <AUTH_TOKEN>' \
         -H 'X-API-Key: <API_KEY>' \
         -d '{
          "pitchAngle": 0
        }'
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "pitchAngle": 0
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json'
    };
    
    fetch('https://api.garuda.io/v2/command/drone/{drone_id}/setCameraPitch',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    200 Response

    {
      "success": true,
      "data": {
        "id": "string",
        "createdBy": "string",
        "createdDate": "2019-07-10T02:48:37.193Z"
      }
    }
    

    POST /command/drone/{drone_id}/setCameraPitch

    Set camera pitch angle. Gimbal will move to specified angle.

    A valid drone_id is required as a URL parameter for a successful command.

    You should pass in the following details in the request body:

    Property Type Description
    pitchAngle Number Move camera gimbal to specified degree

    Airspace API

    Specification for Airspace API for airspace information gathered by Garuda Robotics

    Airspace Data

    Get latest airspace data

    Code samples

    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.garuda.io/v2/airspace/{country_code}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.garuda.io/v2/airspace/{country_code}', params={
    
    }, headers = headers)
    
    print r.json()
    
    curl -X GET 'https://api.garuda.io/v2/airspace/{country_code}' \
         -H 'X-API-Key: <API_KEY>' \
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.garuda.io/v2/airspace/{country_code}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    

    200 Response

    {
      "success": true,
      "data": {
        "type": "FeatureCollection",
        "features": [
          {
            "id": "string",
            "lastUpdatedDate": "2019-07-10T03:09:32.731Z",
            "type": "Feature",
            "geometry": {},
            "properties": {
              "name": "National Day 2017",
              "type": "military_property",
              "description": "National Day 2017 temporary restricted area",
              "rules": [
                {
                  "id": "string",
                  "description": "string",
                  "type": "restricted",
                  "owner": {
                    "name": "string",
                    "type": "government ministry"
                  },
                  "source": {
                    "name": "string",
                    "type": "official website",
                    "url": "string"
                  },
                  "validity": [
                    {
                      "start": "2019-07-10T03:09:32.731Z",
                      "end": "2019-07-10T03:09:32.731Z"
                    }
                  ]
                }
              ]
            }
          }
        ]
      }
    }
    

    GET /airspace/{country_code}

    This endpoint allows you to retrieve the latest available airspace data, based on the country code that is specified. A valid ISO 3166-1 alpha-3 country code is required as a URL parameter.

    The airspace data will be returned as a GeoJSON FeatureCollection object. Each Feature within the FeatureCollection is considered an airspace object, with the following properties:

    Property Type Description
    id String Airspace ID
    lastUpdatedDate String Airspace last updated date
    type String GeoJSON RFC7946 Feature object type
    geometry Object Valid GeoJSON geometry object follow RFC7946 GeoJSON section 3.1 specification
    properties Object Object representing the properties of this airspace

    Each airspace has a field properties, which contain the following information:

    Property Type Description
    name String Name of location / airspace or event
    type String Category of airspace
    description String Additional note about location / airspace or event
    rules Array Array of rule objects that each describe the rules applicable to this airspace

    Each rule object has the following properties:

    Property Type Description
    id String rule unique ID
    description String Additional note about rule
    type String Enumerated strings of rule types: restricted, danger, protected, prohibited, national-park, aerodrome
    owner Object Information about entity that own the rule. Has the properties name and type
    source Object Information on where specified rule is published. Has the properties name, type, and url
    validity Object If validity properties is not given, its assumed that the rule is permanent. Has the properties start and end.