Query Electricity Top-up History

Last Updated on : 2023-06-21 07:13:05

Query the electricity top-up history of an electrical device within the specified time range.

API address

GET: /v1.0/iot-03/power-devices/{device_id}/charge-records

Request parameter

Parameter name Type IN Required Description
device_id String uri true The device ID.
start_time Long query true The start time. The start time must be less than the end time, and the start time must be within 30 days before the current time.
end_time Long query true The end time. The end time must be greater than the start time, and the range from the start time to the end time is less than 7 days.
last_row_key String query false The primary key of the last entry.
size Integer query false The number of items returned on each page. The value must be a positive integer less than 100.

Return parameter

Parameter name Type Description
result CursorPage The top-up history on pages.

Description of result

Parameter name Type Description
has_more Boolean
  1. true: Additional data is available.
  2. false: Additional data is not available.
list List The top-up history.
last_row_key String The row key of the last entry on each page.

Description of list

Parameter name Type Description
charge_time Long The top-up time.
charge_value Double The top-up value.

Request example

GET: /v1.0/iot-03/power-devices/6c31820d9e02f8db7e****/charge-records?start_time=1637652798985&end_time=1637768682437

Return example

{ "result": { "last_row_key": "20370E02F0617161B0F85098C0E1F9E655203E58AD610DC9C386E4C14F95D16F705AFD65C64B20132702D2F146F5****", "list": [ { "charge_value": 2, "charge_time": 1637768682437 }, { "charge_value": 15, "charge_time": 1637758079188 }, { "charge_value": 15, "charge_time": 1637758067950 }, { "charge_value": 15, "charge_time": 1637737706465 }, { "charge_value": 14, "charge_time": 1637737664031 }, { "charge_value": 14, "charge_time": 1637737649861 }, { "charge_value": 1, "charge_time": 1637737518886 }, { "charge_value": 1, "charge_time": 1637652798985 } ], "has_more": false }, "t": 1637809778328, "success": true }

Error code

For more information, see error code.