Get operation list
Retrieves all available operations into the specified project. The operations ar ordered by scheduled time descendent
GET /api/1.0/operations?project={projectId}
Response
Model: application/json
ARRAY
[
{
"id": <Integer> the unique operation id
"syncId": <Integer> unique id used to load the operation into the drone,
"name": <String> The operation name,
"takeOffTime": <String> The operation take off time,
"scheduledTime": <String> The operation scheduled time,
"comments": <String> The operation comments,
"status": <Integer> The operation status, //(1:Scheduled ,2:In progress, 3:Delivered, 4:Incident)
"deliveryTime": <String> The operation delivery time,
}
]
Query parameters
Some parameters are allowed for a filtered response
caution
parameters with * are mandatory
tip
This endpoint return a maximum of 1000 operations, if it's returning this error try to filter for a shorter range of dates or other attributes
* project: <Integer> - Get drones for that project id
name: <String> - It will return operations containing this string in name
from: <String date> - It will return operations older than this date (YYY:MM:DD HH:mm:ss)
to: <String date> - It will return operations previous to this date (YYY:MM:DD HH:mm:ss)
status: <Integer> - It will return simulators or not simulators, (1=Scheduled ,2=In progress, 3=Delivered, 4=Incident)
drone: <Integer> - It will return operations for this drone id
Example
const fetchData=async ()=>{
let j,response;
const serverResponse = await fetch(`https://cloud.rigi.tech/api/1.0/operations?project=22&from=2021-01-01 00:00:00&to=2022-01-01 00:00:00&status=1&drone=21&name=test`, {
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": 220,
"name": "test operation 1",
"takeOffTime": null,
"scheduledTime": "2021-11-16T17:47:42.000Z",
"comments": null,
"status": 1,
"deliveryTime": null
},
{
"id": 235,
"name": "test operation 2",
"takeOffTime": null,
"scheduledTime": "2021-11-22T14:08:54.000Z",
"comments": null,
"status": 1,
"deliveryTime": null
},
{
"id": 296,
"name": "test operation 3",
"takeOffTime": null,
"scheduledTime": "2021-12-16T08:52:47.000Z",
"comments": null,
"status": 1,
"deliveryTime": null
}
]