Get Daily Activated Devices

Last Updated on : 2024-07-18 02:45:53download

Count the number of daily activated devices based on the start date and end date. The start and end dates cannot be more than 60 days apart.

API address

GET: /v1.0/cloud/analytics/devices/active-datas/date

Request parameter

Parameter nameTypeINRequiredDescription
start_dayStringquerytrueThe start date in the format of yyyyMMdd.
end_dayStringquerytrueThe end date in the format of yyyyMMdd. The start and end dates cannot be more than 60 days apart.
product_idStringqueryfalseThe ID of the specified product in the cloud development project under the Tuya Developer Platform account.

Return parameter

Parameter nameTypeDescription
resultListThe returned result.
successBooleanIndicates whether the operation is successful. Valid values:
  • true: The operation succeeded.
  • false: The operation failed.
tLongThe timestamp.
tidStringThe link ID.

Description of result

Parameter nameTypeDescription
The date.IntegerThe number of activated devices under the product ID (if a product_id is specified) or under all product IDs under the Tuya Developer Platform account (if a product_id is not specified) on the current day.

Request example

GET: /v1.0/cloud/analytics/devices/active-datas/date?start_day=20230723&end_day=20230729

Return example

{
    "tid": "3b135d8f2b9611ee8b88c69b14dfb1da",
    "result": [
        {
            "20230724": 11
        },
        {
            "20230725": 9
        },
        {
            "20230726": 0
        }
    ],
    "t": 1690363473511,
    "success": true
}

Error code

For more information, see error code.