Unit History Access Violation

Solved!
Posted in Methods by Günter Kapfer Mon Sep 17 2018 07:15:10 GMT+0000 (Coordinated Universal Time)·5·Viewed 489 times

Hi, i can not call the Report/UnitHistory endpoint without getting the error "AccessViolation". The Report/UnitExtendedInfo works without an issue and has nearly the same parameters. I noticed the difference between the parameters "unitId" and "id" so i tryed both without success. The parameters from and to date are the same for both requests so there can't be a typo. thx
Trackunit API Team
Sep 19, 2018

Hi,

Below is an example on how you should use the Report/UnitHistory API (just replace with your own API token and unit-id and the period of interest):

https://api.trackunit.com/public/report/UnitHistory?token=<api-token>&unitid=<unitid>&from="2018-09-18T00:00:00.0000000"&to="2018-09-19T00:00:00.0000000"

If you still have problem, then please contact our Customer Care directly (https://www.trackunit.com/support/) and provide details on your account and how you invoke the API. Please do not provide these details in this open forum.

Best Regards,
Trackunit Support

Günter Kapfer
Sep 20, 2018

i replaced api-token and unitid and tryed your example without success. I still get an error message "403 Forbidden". Sending the request by POST doesn't change anyting. The request with the same values for the Report/UnitExtendedInfo endpoint works. I will concact the suport and provide more details about my problem.

Thank you for your help.

Trackunit API Team
Sep 20, 2018

OK, and thanks. Then we'll have more details to investigate this.

Best Regards,
Trackunit Support


Trackunit API Team marked this as solved
Günter Kapfer
Sep 27, 2018

Just for everyone wo encounters the same problem.

When creating an account there are some Options. One is called "Hide historical data". When this option is ticked, the requests for the reporting endpoints fails with an "AccessViolation".

Unticking this option for my account by the fleetmanager solved my problem.
Another solution would have been to use the api-token from the fleet manager.

Trackunit API Team
Sep 27, 2018

Thanks for sharing Günther!

In other words, the cause for your challenges was that your user didn't have permission to view historic data which also blocks for using the report APIs.

Best Regards,
Trackunit Support

Markdown is allowed