API of the new version of traccar (reports)

Eduardo Maciel9 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 Tananaev9 months ago

Are you sending the "Accept" header?

Eduardo Maciel9 months ago

I'm sending Content-Type application/json

Anton Tananaev9 months ago

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

Eduardo Maciel9 months ago

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

Eduardo Maciel9 months ago

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

Track-trace9 months ago

@Eduardo Maciel

Can you show howto please

Adriano Miranda9 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