Entity Information (Request Data)

Data type: VirtualHourmeterData, fields list

Data is passed in request as XML or Json serialized data depending on response-type header value.

URL

  • /api/assets/{assetId}/setvirtualhourmeter

HTTP Method: PUT

Description

Sets value for virtual hourmeter for given asset and triggers related calculations

assetId (mandatory): Asset identifier

Request data has 3 fields in VirtualHourmeterData structure:

  • Hours - hourmeter value
  • UtcDate - date/time in UTC timezone when hourmeter value was measured
  • TerminalId - id of terminal to be updated. If terminalId is not specified it is detected automatically based on AssetId

The Trakopolis API server finds existent terminal status, nearest to UtcDate passed and assign hourmeter value to this status. If TerminalId is not specified and given asset doesn't have any terminals or have more than 1 terminal, an error will be returned.

If errors occured during updating hourmeter, the Trakopolis API server returns detailed error status with possible error codes:

  • AssetMultipleTerminals - asset has multiple terminals and application should pass specific TerminalId to update value;
  • AssetNotFound - requested asset is not found or can'be accessed by caller application;
  • AssetNoTerminals - requested asset doesn't have any terminals;
  • AssetTerminalNotFound - requested terminal is not found;
  • TerminalNoLocationDateFound - failed to find existent status nearest to UtcDate. Probably terminal doesn't have any statuses yet.
  • WrongDataFormat - Invalid input data format in VirtualHourmeterData structure.