Get battery types list
Retrieves all available battery types
GET /api/1.0/batterytypes
Response
Model: application/json
ARRAY
[
{
"id": <Integer> the battery type id
"name": <String> The battery type name,
"manufacture": <String> MAnufacture name,
"model": <string> Battery typoe model name,
"voltage": <Integer> Battery type voltage (volts)
"cells": <Integer> Battery type cells number,
"chemistry": <string> Battery type chemistry
"capacity": <Integer> Battery type capacity (Ah)
"maxDischargeCurrent": <Integer> Battery type discharge current (A)
"weight": <Integer> Battery type weight (g)
"length": <Float> Battery type length (mm)
"width": <Float> Battery type width (mm)
"height": <Float> Battery type height (mm)
}
]
Example
const fetchData=async ()=>{
let j,response;
const serverResponse = await fetch(`https://cloud.rigi.tech/api/1.0/batterytypes`, {
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": 1,
"name": "Eiger Kamikaze Test Battery (12S)",
"manufacture": "Vant",
"model": "Vant 22Ah 6S 1190190HP AS150 - pack of 2",
"voltage": 22,
"cells": 6,
"chemistry": "LiPo",
"capacity": 22,
"maxDischargeCurrent": 660,
"weight": 2700,
"length": 203,
"width": 69,
"height": 94
},
{
"id": 2,
"name": "Minto Flight Battery (6S)",
"manufacture": "Tattu",
"model": "Tattu 7Ah 6S 25C XT90",
"voltage": 22.2,
"cells": 6,
"chemistry": "LiPo",
"capacity": 7000,
"maxDischargeCurrent": 175,
"weight": 907.5,
"length": 136.48,
"width": 68.28,
"height": 42.07
}
]