It is possible to send the location or touch to make a connection protocol that simulates the GPS
Can you please provide a link where you found this API.
I'm developing there is no link I share all the code?
I'm not asking for your code. I'm asking where you found this API endpoint. Surely it's not just a random guess.
I am guided by the documentation https://www.traccar.org/traccar-api/
if I had it wrong change it to this code
var positionUrl = $"{serverUrl}api/positions/";
var content = new FormUrlEncodedContent(new Dictionary<string, string>
{
{ "deviceId", positionData.deviceId.ToString() },
{ "latitude", positionData.latitude.ToString() },
{ "longitude", positionData.longitude.ToString() },
{ "timestamp", positionData.timestamp.ToString() }
});
var response = await httpClient.GetAsync(positionUrl);
There's no API to add a position, so what you're trying to do won't work using the API. Instead you should use one of the protocols. For example OsmAnd.
if I already imagined it I thought it also works then thank you very much for your help friend Anton I'm going to do what I say and implement a connection protocol
ready friend anton and manage to report the location through the Osmand protocol
At the moment it is only to send a static location
thank you very much for your help
greetings I'm trying to send the location from a program in c # Which I'm using this code through the GET method the program runs perfect and is sending me an exact location in the code. and I'm not really sure if this is compatible with the Traccar API
this is a parter of the code and manage to authenticate me
var positionData = new { latitude, longitude, deviceId = 136, timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }; var positionUrl = $"{serverUrl}api/positions?deviceId={positionData.deviceId}&latitude={positionData.latitude}&longitude={positionData.longitude}×tamp={positionData.timestamp}"; var response = await httpClient.GetAsync(positionUrl);
Console
Location sent successfully.