getOutdoorsTracksDetail(data: GetOutdoorsTracksDetailParams)

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

Description

Retrieve device track points by time range. The time span between start and end must be ≤ 7 days, and up to 1000 points are returned per request. If there are more than 1000 points in the period, the first 1000 points and the start time for the next query are returned. To improve response speed and avoid timeouts due to excessive points, shorten each request’s time window and split the track into segments for stitching.

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

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

Referenced Types

typeGetOutdoorsTracksDetailResult
PropertyTypeDescription
deviceIdstringDevice ID
Track point list
startTimenumberStart timestamp for the next-page query
hasMorebooleanWhether there is a next page

Examples

Request example

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

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

Response example

{
  "deviceId": "vdevo16245017293****",
  "hasMore": false,
  "pointList": [
    {
      "lon": 114.003117,
      "battery": 100,
      "speed": 100,
      "protocol": "GPS",
      "lat": 22.594031,
      "mileage": 0,
      "timestamp": 1625198100154
    }
  ]
}