Gyro Sweeper Data API

Last Updated on : 2021-09-10 08:43:53download

This topic introduces the interfaces for querying device data in the sweeper panel SDK.

getGyroMapLatestMedia

Query the latest streaming service record details data.

Request parameters

Parameter Data type Description Required?
opt IGetGyroMapLatestMediaOpts see the IGetGyroMapLatestMediaOpts No

IGetGyroMapLatestMediaOpts

Parameter Data type Description Required?
offset String The position to start the query, refers to the result of the nextOffset of the last query, if the first query is not required No
limit Number Maximum number of map data in one query. Default value: 500. No

Response parameters

Parameter Data type Description
response IGyroMapMediaExport see the IGyroMapMediaExport

IGyroMapMediaExport

Parameter Data type Description
dataList String[] Map data
subRecordId Number Streaming service ID
nextOffset String Where to start searching on the next page

JavaScript request exapmle

import { GyroDataApi } from '@tuya/tuya-panel-robot-sdk' GyroDataApi.getGyroMapLatestMedia({ offset: '', limit: 500 }).then((response) => { console.log(response) }).catch()

Response example

{ dataList: [], subRecordId: 0, nextOffset: '', }

getGyroMapHistoryMediaBySubRecordId

Query the detailed data of a streaming service record.

Request parameters

Parameter Data type Description Required?
opt IGetGyroMapHistoryMediaOpts see the IGetGyroMapHistoryMediaOpts No

IGetGyroMapHistoryMediaOpts

Parameter Data type Description Required?
offset String The position to start the query, refers to the result of the nextOffset of the last query, if the first query is not required No
limit Number Maximum number of map data in one query. Default value: 500. No
subRecordId String Stream Service Record Id Yes

Response parameters

Parameter Data type Description
response IGyroMapMediaExport see the IGyroMapMediaExport

IGyroMapMediaExport

Parameter Data type Description
dataList String[] Map data
subRecordId Number Streaming service ID
nextOffset String Where to start searching on the next page

JavaScript request exapmle

import { GyroDataApi } from '@tuya/tuya-panel-robot-sdk' GyroDataApi.getGyroMapHistoryMediaBySubRecordId({ subRecordId: '1', offset: '', limit: 500 }).then((value) => { console.log(value) }).catch()

Response example

{ dataList: [], subRecordId: 0, nextOffset: '', }

getGyroMapHistoryList

Query the cleaning record list.

Request parameters

Parameter Data type Description Required?
opt IGetGyroHistoryListOpts see the IGetGyroHistoryListOpts No

IGetGyroHistoryListOpts

Parameter Data type Description Required?
cleanRecordCode String Clean up records dpCode. Default value: clean_record. No
page Number Query the number of pages. Default value: 0. No
pageLimit Number Display the most data per page. Default value: 10. No
startTime Number Start time unix timestamp No
endTime Number End time unix timestamp No

Response parameters

Parameter Data type Description
response IRecordExportList see the IRecordExportList

IRecordExportList

Parameter Data type Description
dataList IRecordExportData[] Clean the record list, see the IRecordExportData
hasNext Boolean Is there a next page

IRecordExportData

Parameter Data type Description
id String The cleaning record ID
value String The cleaning record content
timestamp Number Cloud timestamp

JavaScript request exapmle

import { GyroDataApi } from '@tuya/tuya-panel-robot-sdk' GyroDataApi.getGyroMapHistoryList({ cleanRecordCode: 'clean_record', page: 1, pageLimit: 10, }).then((value) => { console.log(value) }).catch()

Response example

{ dataList:[{ id: '', value: '', timestamp: 0, }], hasNext: false }

deleteGyroMapHistoryByIds

Delete cleaning records.

Request parameters

Parameter Data type Description Required?
ids String[] cleaning records Id No

Response parameters

Parameter Data type Description
response Boolean Is the deletion successful

JavaScript request exapmle

import { GyroDataApi } from '@tuya/tuya-panel-robot-sdk' GyroDataApi.deleteGyroMapHistoryByIds(['1']).then((value) => { console.log(value) }).catch()

Response example

true