getImageTransferHistory(data: GetImageTransferHistoryParams)

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

Description

Cursor-paginated query for image transfer upload/print history

Parameters

ParameterTypeRequiredDescription
YesRequest parameters

Return Value

Type: Promise<GetImageTransferHistoryResult>
GetImageTransferHistoryResult (includes record list, has-more flag, and next-page cursor)

Referenced Types

interfaceGetImageTransferHistoryResultResult of querying image transmission upload/print history
PropertyTypeDescription
Record list in reverse chronological order; returns only records that have not been deleted
hasMorebooleanWhether there is a next page
cursorstringNext-page cursor; may be empty when hasMore is false

Examples

Request example

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

getImageTransferHistory({
  pageSize: 20,
  deviceId: '6cbed8370dd694e247uk9u',
  homeId: '123456789',
})
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.error('Failed to get image transfer history:', error);
  });

Response example

{
  "list": [
    {
      "id": 101,
      "fileName": "b2f2d6f65eedcfd189bb341e3baa1d28_1722760086681.jpg",
      "objectKey": "tc_permanent/123456789/b2f2d6f65eedcfd189bb341e3baa1d28_1722760086681.jpg",
      "userInput": "My photo",
      "status": "SUCCESS",
      "gmtCreate": 1722760086681,
      "downloadUrl": {
        "url": "https://example.com/origin.jpg?sign=xxx",
        "thumbnailUrl": "https://example.com/thumbnail.jpg?sign=xxx"
      }
    }
  ],
  "hasMore": false,
  "cursor": ""
}

FAQ

Why does the call to cloud capabilities fail?

Before using this API, please ensure that the product to which the device belongs has enabled the Image Transfer advanced capability on the Tuya IoT Development Platform. Devices without this capability enabled cannot perform image upload or printing, and the API will return empty data or an error. If you need to use it, please create a product that supports image transfer/printing functions and enable the corresponding advanced capabilities in the product details. At the same time, the API depends on cloud capabilities, and authorization configuration is required in Development Settings - Cloud Capabilities on the Mini Program Developer Platform.