tc_devices expirationtime is reset to null from API

mbodea20076 months ago

Hello,

after calling the API to Update a Device on /api/devices/{id} , the db column expirationtime on tc_devices is reset to NULL.
(It works OK on /api/devices/{id}/accumulators ).
Thx.
Marius

Anton Tananaev6 months ago

You probably passed expirationtime as NULL in your API request.

mbodea20076 months ago

I am not passing expirationtime at all, because it is not part of the Device object.
Thx

Anton Tananaev6 months ago

You're mistaken.

mbodea20076 months ago

The device object, according to API docs is:

[
  {
    "id": 0,
    "name": "string",
    "uniqueId": "string",
    "status": "string",
    "disabled": true,
    "lastUpdate": "2019-08-24T14:15:22Z",
    "positionId": 0,
    "groupId": 0,
    "phone": "string",
    "model": "string",
    "contact": "string",
    "category": "string",
    "attributes": {}
  }
]

there is a lastupdate, but not an expirationtime...
Thx

Anton Tananaev6 months ago

We probably haven't updated the documentation when it was added. Feel free to send a pull request.

mbodea20076 months ago

Indeed.
The API docs is probably outdated.
The pull request shows all Device properties.
Problem fixed.
Thx.