Update total distance and hours of the Device PUT /devices/{id}/accumulators

KWARN KHAM 7 years ago

Hi,

I have tested the api but don't get expected resulted.

Here is how I tested via chrome extension called RESTlet Client,
url => https://webAddress/api/devices/214565766/{'deviceId':1168, 'totalDistance': 0, 'hours': 0}

As I don't know what does {id} mean (I don't see description about it), I guess it might be the 'id' from tc_positions or 'deviceId' and tested both.
As for accumulators, the documentation says it an object of 3 properties('deviceId', 'totalDistance', 'hours').
I provided admin account for authentication and application/json as Content-Type.

The response is HTTP 404 Not Found - NotFoundException (...) and no data is updated.

Thanks.

KWARN KHAM 7 years ago

Sorry I forgot to mention that I used 'PUT' method.

Anton Tananaev 7 years ago

Your URL doesn't make any sense to me. Why is JSON embedded in the URL?

KWARN KHAM 7 years ago

Hi Anton,
The api url is /devices/{id}/accumulators. If I want to update total distance, how do I set the url?

Anton Tananaev 7 years ago

Check what official web app sends, if documentation is not enough.