API of the new version of traccar (reports)

Eduardo Maciel8 months ago

Hello, I'm trying to consume the API of the new version of traccar, but the requests at the reports endpoint (tris, stops, summary) are having problems. Does anyone have a solution?

Return this in the response

PKPKPKPKPKPKPKPKPKPKPKPK

Anton Tananaev8 months ago

Are you sending the "Accept" header?

Eduardo Maciel8 months ago

I'm sending Content-Type application/json

Anton Tananaev8 months ago

You have to send the Accept header. This has been discussed many times before.

Eduardo Maciel8 months ago

What is the value of accept? This header information is not included in the API documentation

Eduardo Maciel8 months ago

I'm sending Accept application/json and it worked. Thanks

Track-trace8 months ago

@Eduardo Maciel

Can you show howto please

Adriano Miranda8 months ago

@Track-trace The required approach may vary depending on the programming language or software you're using to make the call. However, you can simply add one more key to your header like Accept: application/json