Skip to main content

Get drone information

Retrieves drone information for the specified drone. You can get the drone id listing all the drones first

 GET /api/1.0/drone/{droneId}
tip

droneId can be obtained from the get drone list endpoint. You can use the id field or the serialNumber field. Both values will work.

Response

Model: application/json


{
"id": <Integer> the unique id of the drone
"serialNumber": <String> The serial number for the drone,
"model": <String> Drone model,
"revision": <string> Revision for the drone,
"registrationDate": <String> Drone registration date into the system,
"simulator": <Boolean> Indicates if is a simulator,
"emptyWeight": <Float> Empty weight for the drone (in kg),
"status": <Integer> Status for the drone (1 = active, 0 = inactive)
}

Example

const fetchData=async ()=>{
let j,response;
const serverResponse = await fetch(`https://cloud.rigi.tech/api/1.0/drone/41`, {
mode: "cors",
method: "GET",
referrer: "no-referrer",
headers: {"authorization": "Bearer " + token}
})
if(!serverResponse.ok){
try {
switch (serverResponse.status){
case 400:
j = await serverResponse.json();
break;
case 403:
response = { message: "Forbidden access to data" };
case 404:
response = { message: "Address not found" };
default:
j = await serverResponse.json()
}
} catch (e) {
response = { message: "Error fetching data" };
}
}else{
j = await serverResponse.json()
}

response = { data:j };
const {data, message} = response
if(message) console.debug(message)
if(data) console.debug(data)
}
fetchData()

Answer:

{
"id": 41,
"serialNumber": "SIM_DEV_CARLOS",
"model": "SimVtol",
"revision": "2",
"registrationDate": "1970-01-01T00:00:00.000Z",
"simulator": true,
"emptyWeight": 10,
"status": 1
}