Retrieve Cloud Development Data

Last edited on 2026-04-08

This API should be called on the server side and cannot be called directly on the client side (Mini Program, web page, APP, etc.). For details, please refer to API Call Guide.

API English Name: getCloudBaseStatistics

This API is used to retrieve Cloud Development data.

1. Call Method

HTTPS Call

POST https://api.weixin.qq.com/tcb/getstatistics?access_token=ACCESS_TOKEN

Cloud Call

  • Call Method: cloudbase.getStatistics

  • Input and output parameters are the same as HTTPS call. For call method, please refer to Cloud Call documentation.

Third-party Call

  • This API supports third-party platforms on behalf of Merchant call.

  • The permission set ID of this API is: 49

  • After the service provider obtains one of the permission set authorizations, it can use authorizer_access_token to call on behalf of Merchant, for details please refer to Third-party Call documentation.

2. Request Parameters

Query Parameters Query String Parameters

ParameterTypeRequiredDescription
access_tokenstringYesAPI call credential, you can use authorizer_access_token

Request Body Request Payload

ParameterTypeRequiredDescription
actionstringYesThe retrieval action. Currently supported values: `smsMarketingOverviewData` (SMS Marketing Overview Data), `smsMarketingConversionData` (SMS Marketing Conversion Data), and `smsMarketingRealTimeData` (SMS Marketing Real-Time Data).
begin_datenumberYesStart timestamp
end_datenumberYesEnd timestamp
page_limitnumberYesPagination limit [Required when `action` is set to `smsMarketingOverviewData` or `smsMarketingConversionData`]
page_offsetnumberYesPagination offset [Required when `action` is set to `smsMarketingOverviewData` or `smsMarketingConversionData`]

3. Response Parameters

Response Body Response Payload

ParameterTypeDescription
data_columnobjarrayData column definitions
data_valueobjarrayData rows
total_numnumberTotal number of rows

Res.data_column(Array) Object Payload

Data column definitions

ParameterTypeDescription
col_idstringColumn ID
col_namestringColumn name
col_data_typestringData type (0: string; 1: number; 2: double)

Res.data_value(Array) Object Payload

Data rows

ParameterTypeDescription
data_valuearrayData values

4. Notes

No special notes for this API

5. Code Example

5.1 HTTPS Request Example

Request Example

{
  "action": "smsMarketingOverviewData",
  "begin_date": 1614182400,
  "end_date": 1614268800,
  "page_offset": 0,
  "page_limit": 1000,
  "condition": {
    "env_id": "xxx",
    "activity_id": "xxx",
    "by_channel_id": "0"
  }
}

Response Example

{
 "data_column": [
 {
 "col_id": "appid",
 "col_name": " Mini Program id",
 "col_data_type": "0"
},
 {
 "col_id": "env_id",
 "col_name": "Environment ID",
 "col_data_type": "0"
},
 {
 "col_id": "activity_id",
 "col_name": "Activity ID",
 "col_data_type": "0"
},
 {
 "col_id": "channel_id",
 "col_name": "Channel",
 "col_data_type": "0"
},
 {
 "col_id": "h5_open_uercnt",
 "col_name": "Number of H5 Users Opened",
 "col_data_type": "1"
},
 {
 "col_id": "jump_wxapp_uercnt",
 "col_name": " Mini Program Jump Users Count",
 "col_data_type": "1"
},
 {
 "col_id": "sms_send_uercnt",
 "col_name": "Number of SMS Recipients",
 "col_data_type": "1"
},
 {
 "col_id": "sms_send_list",
 "col_name": "Delivery Record Array",
 "col_data_type": "0"
},
 {
 "col_id": "jump_wxapp_uercnt_percent",
 "col_name": "Jump User Ratio by Channel",
 "col_data_type": "2"
},
 {
 "col_id": "h5_open_uercnt_percent",
 "col_name": "H5 Open User Ratio by Channel",
 "col_data_type": "2"
},
 {
 "col_id": "h5_sms_rate",
 "col_name": "SMS to H5 Conversion Rate",
 "col_data_type": "2"
},
 {
 "col_id": "jump_h5_rate",
 "col_name": "H5 to Jump Conversion Rate",
 "col_data_type": "2"
}
],
 "data_value": [
 {
 "data_value": [
 "xxxxxxxxxxxxxxxxxx",
 "wedcvfr",
 "21ded5cb6001691405171ba161c603d1",
 "_cms_sms_",
 "5000",
 "3000",
 "10000",
 "[task1:5000,task2:5000]",
 "0.535714",
 "0.625",
 "0.5",
 "0.6"
]
}
],
 "total_num": 1
}

5.2 Cloud Function Call Example

Request Example

const cloud = require('wx-server-sdk')
cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV,
})
exports.main = async (event, context) => {
  try {
    const result = await cloud.openapi.cloudbase.getStatistics({
        "action": 'smsMarketingOverviewData',
        "condition": {
          "envId": 'xxx',
          "activityId": 'xxx',
          "byChannelId": '0'
        },
        "beginDate": 1614182400,
        "endDate": 1614268800,
        "pageOffset": 0,
        "pageLimit": 1000
      })
    return result
  } catch (err) {
    return err
  }
}

Response Example

{
 "dataColumn": [
 {
 "colId": "appid",
 "colName": " Mini Program id",
 "colDataType": "0"
},
 {
 "colId": "env_id",
 "colName": "Environment ID",
 "colDataType": "0"
},
 {
 "colId": "activity_id",
 "colName": "Activity ID",
 "colDataType": "0"
},
 {
 "colId": "channel_id",
 "colName": "Channel",
 "colDataType": "0"
},
 {
 "colId": "h5_open_uercnt",
 "colName": "Number of H5 Users Opened",
 "colDataType": "1"
},
 {
 "colId": "jump_wxapp_uercnt",
 "colName": " Mini Program Jump Users Count",
 "colDataType": "1"
},
 {
 "colId": "sms_send_uercnt",
 "colName": "Number of SMS Recipients",
 "colDataType": "1"
},
 {
 "colId": "sms_send_list",
 "colName": "Delivery Record Array",
 "colDataType": "0"
},
 {
 "colId": "jump_wxapp_uercnt_percent",
 "colName": "Jump User Ratio by Channel",
 "colDataType": "2"
},
 {
 "colId": "h5_open_uercnt_percent",
 "colName": "H5 Open User Ratio by Channel",
 "colDataType": "2"
},
 {
 "colId": "h5_sms_rate",
 "colName": "SMS to H5 Conversion Rate",
 "colDataType": "2"
},
 {
 "colId": "jump_h5_rate",
 "colName": "H5 to Jump Conversion Rate",
 "colDataType": "2"
}
],
 "dataValue": [
 {
 "dataValue": [
 "xxxxxxxxxxxxxxxxxx",
 "wedcvfr",
 "21ded5cb6001691405171ba161c603d1",
 "_cms_sms_",
 "5000",
 "3000",
 "10000",
 "[task1:5000,task2:5000]",
 "0.535714",
 "0.625",
 "0.5",
 "0.6"
]
}
],
 "totalNum": 1,
 "errMsg": "openapi.cloudbase.getStatistics:ok"
}

6. Error Codes

The following is the error code list of this API, other error codes can refer to Common Error Codes; When encountering errors in calling the API, you can use the official API Diagnostic Tool to assist in locating and analyzing problems.

Error CodeError DescriptionSolution
10011No data available

7. Applicable Scope

API callable status for different account types:
Mini ProgramMini Game
✔ ✔
  • ✔:This account type can call this API。
  • Other account types not explicitly declared cannot call this API unless otherwise specified.