Skip to main content

Get operation information

Retrieves operation information for the specified operation. You can get the operation id listing all the operations first

 GET /api/1.0/operation/{operationId}

Response

Model: application/json


{
"id": <Integer> The unique operation id
"syncId": <Integer> The unique id for the operation, this id is what matches with the telemetry
"name": <String> The operation name
"route": <Integer> The route id,
"takeOffTime": <String> The operation takeoff time,
"scheduledTime": <string> The operation scheduled time,
"comments": <String> The operation comments,
"status": <Itneger> The operation status, //(1:Scheduled ,2:In progress, 3:Delivered, 4:Incident)
"deliveryTime": <string> The operation delivery time,
"drone": <Integer> The drone id
"batteries": <Array> Array of all the batteries (serial number) for this operation
"pic": <Integer> Pilot in command (user id)
"groundOperators": <Array> Array of user id of the operation ground operators
"payload": <Float> Operation payloag (kg)
"duration": <String> Operation duration (HH:mm:ss)
"distance": <Integer> Operation flight distance (m)

}

Example

const fetchData=async ()=>{
let j,response;
const serverResponse = await fetch(`https://cloud.rigi.tech/api/1.0/operation/257`, {
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": 257,
"name": "Test operation",
"takeOffTime": "2021-11-24T12:00:49.000Z",
"scheduledTime": "2021-11-24T12:30:21.000Z",
"comments": null,
"status": 3,
"deliveryTime": "2021-11-24T12:38:15.000Z",
"drone": 29,
"batteries":["BAT-MT-01-00102", "BAT-MT-01-00103"],
"pic": 31,
"groundOperators":[4,6],
"payload": 1.5,
"duration": "00:37:26",
"distance": 52866
}