getOutdoorsTracksSegments(data: GetOutdoorsTracksSegmentsParams)

Requires:
@tuya-miniapp/cloud-api≥1.0.5

Description

Paginated retrieval of device track segments. The difference between end time and start time must be ≤ 7 days. Up to 1000 segments are returned per call. If the number of segments in the time range exceeds 1000, the first 1000 segments are returned along with the start ID for the next page.

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<GetOutdoorsTracksSegmentsResult>
GetOutdoorsTracksSegmentsResult (see type definitions and the minituya return table for field meanings)

Referenced Types

typeGetOutdoorsTracksSegmentsResult
TrackSegment[]

Examples

Request example

import { getOutdoorsTracksSegments } from '@tuya-miniapp/cloud-api';

getOutdoorsTracksSegments({
  deviceId: 'vdevo16245017293',
  startTime: 1625198100154,
  endTime: 1625198190154,
})
  .then((response) => {
    console.log(response);
  })
  .catch();

Response example

{
  "deviceId": "vdevo16245017293****",
  "segmentList": [
    {
      "endTime": 1625198190154,
      "battery": 5,
      "speed": 100,
      "duration": 3000,
      "startTime": 1625198100154,
      "mileage": 10
    }
  ],
  "hasMore": false
}