Web Server: Trying to webserver-receive only what I need

Alsolcru4 years ago

Hello to all the community, my first time here and new in Traccar (Awesome software BTW ;-) )

I'm pointing the received event of the traccar app (running in windows 10) to my own web server. I show it with a python file that only have the propose for debug in order to then build my service. I want to receive a json with some test variables like position, time, etc for test but instead I receive a json file with almost all the info that traccar looks like is able to send even with the line "forward.json'>false<":

object {4}
  position {18}
  event {8}
  device {14}
  user {3}

My traccar.xml is:

<entry key='database.driver'>org.h2.Driver</entry>
<entry key='database.url'>jdbc:h2:./data/database</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'></entry>
<entry key='forward.json'>false</entry>

<entry key='event.forward.enable'>true</entry>
<entry key='event.forward.url'>http://MyServerIp:8840/?event&amp;position&amp;users</entry>

I will appreciate a clue in order to receive event,position,user as an example of data.

Thanks in advance and feel free to ask for more details.

Anton Tananaev4 years ago

Event forwarding only supports JSON. The forward.json config parameter only applies to position forwarding, not event forwarding.

Alsolcru4 years ago

Thanks Anton for your quick answer. With what you declare, in witch way is possible to send a JSON string only with a few variables instead of the complete data?
I took my example 'event.forward.url' from this forum. The new Traccar version deprecate it?

Regards
Alsolcru.

Anton Tananaev4 years ago

It's not configurable.

Alsolcru4 years ago

Thanks for the info Anton.
My goal is to develop a report service in my server. From where in the code you suggest to dive in order to build it? Thanks in advance.

Alsolcru3 years ago

Hello Anton... I manage to get what I need configuring traccar to use a MySQL database. There is all the data that I can use and more! :-)