Hello,
I'm testing API Osmand in Traccar, it works well thanks to your documentation.
But i want to try other params that are not mentionned in the documentation.
I meet difficulties.
For example, i've got a request like this :
http://localhost:5055/?id=123458&lat=50&lon=65×tamp=1559806980&hdop=5&altitude=35&speed=0
And i want to use the record_photo function, found here : https://github.com/osmandapp/osmand-api-demo
But how to use it? I'd love if you could give me a concrete example
http://localhost:5055/?id=123458&lat=50&lon=65×tamp=1559806980&hdop=5&altitude=35&speed=0&record_photo
const base64 = require("base-64");
const id = YOUR_DEVICE_ID;
const lat = LATTITUTE;
const lon = LONGITUTE;
const timestamp = new Date().toISOString();
const hdop = HDOP;
const altitude = ALTITUTE;
const speed = SPEED;
const username = YOUR_EMAIL_OR_USERNAME;
const password = YOUR_PASSWORD;
const base64Auth = base64.encode(`${username}:${password}`);
const url = `http://YOUR_SERVER:5055/?id=${id}&lat=${lat}&lon=${lon}×tamp=${timestamp}&hdop=${hdop}&altitude=${altitude}&speed=${speed}`;
fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Basic ${base64Auth}`,
},
})
.then((response) => {
if (response.ok) {
console.log("Write request sent successfully!");
} else {
console.log(response);
throw new Error("Failed to send write request.");
}
})
.catch((error) => {
console.error("Error:", error);
});
Hello,
I'm testing API Osmand in Traccar, it works well thanks to your documentation.
But i want to try other params that are not mentionned in the documentation.
I meet difficulties.
For example, i've got a request like this :
And i want to use the record_photo function, found here : https://github.com/osmandapp/osmand-api-demo
But how to use it? I'd love if you could give me a concrete example