Skip to main content

Get bases list

Retrieves all available bases into the specified project

 GET /api/1.0/bases?project={projectId}

Response

Model: application/json

ARRAY 
[
{
"id": <Integer> Base unique id
"name": <String> The base name,
"description": <String> The base description
"lat": <Float> The base latitude
"lng": <Float> The base longitude
"altitude": <Integer> The base altitude (AMSL)
}
]

Query parameters

caution

parameters with * are mandatory

* project: <Integer> - Get drones for that project id

Example

const fetchData=async ()=>{
let j,response;
const serverResponse = await fetch(`https://cloud.rigi.tech/api/1.0/bases?project=22`, {
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": 8,
"name": "Lausanne airport",
"description": "Hospital in Svendborg",
"lat": 50.0549,
"lng": 10.6039,
"altitude": 480
},
{
"id": 9,
"name": "Geneve airport",
"description": "Hospital in Odense",
"lat": 50.3849,
"lng": 10.3701,
"altitude": 400
},
]