If you haven't fixed it by now, I suggest firing up a small webserver to accept the GET request and send a POST request
https://github.com/tananaev/traccar/blob/master/src/org/traccar/WebDataHandler.java
this link is offline.
Please write again where to find the attributes.
Just search for the file in the repo.
Is there any way to forward the timestamp={} in a unix timestamp, when forwarded?
For anyone looking this is the latest file location
https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/forward/PositionForwarderUrl.java
.replace("{name}", URLEncoder.encode(device.getName(), StandardCharsets.UTF_8))
.replace("{uniqueId}", device.getUniqueId())
.replace("{status}", device.getStatus())
.replace("{deviceId}", String.valueOf(position.getDeviceId()))
.replace("{protocol}", String.valueOf(position.getProtocol()))
.replace("{deviceTime}", String.valueOf(position.getDeviceTime().getTime()))
.replace("{fixTime}", String.valueOf(position.getFixTime().getTime()))
.replace("{valid}", String.valueOf(position.getValid()))
.replace("{latitude}", String.valueOf(position.getLatitude()))
.replace("{longitude}", String.valueOf(position.getLongitude()))
.replace("{altitude}", String.valueOf(position.getAltitude()))
.replace("{speed}", String.valueOf(position.getSpeed()))
.replace("{course}", String.valueOf(position.getCourse()))
.replace("{accuracy}", String.valueOf(position.getAccuracy()))
.replace("{statusCode}", calculateStatus(position));
Any chance to have the eventcode forwarded as well (sos,overspeed etc)
In what variable will that be forwarded ?
And an up to date list of arguments?
No matter which i try in my forwardURL i only get stuff like this in my log
2024-02-07 07:33:31 INFO: [Tfcfde3e5] error - The template variable 'name' has no value - IllegalArgumentException (... < EventForwarderJson:41 < NotificationManager:141 < *:83 < *:155 < ConnectionManager:247 < ...)
You cannot use template variables with JSON forwarding. In fact event forwarding doesn't support it at all.
Ok, I'm trying to use Traccar as "GPS proxy" to pass location data to another tracking service as osmand format. My problem is GET request type instead of POST. How I can change it?
Here is part of config:
<entry key='forward.enable'>true</entry> <entry key='forward.url'>http://example.org:5055/?id={uniqueId}&lat={latitude}&lon={longitude}&timestamp={deviceTime}&hdop={accuracy}&altitude={altitude}&speed={speed}</entry>