#  Get Template Send Statistics Data - GetUSMSTemplateSendStatistics

## Overview

Obtain Template Sending Statistics Data






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `GetUSMSTemplateSendStatistics`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.scloudsg.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ProjectId** | string | Project ID. Leave it blank for the default project. Sub-accounts must fill in. Please refer to the [GetProjectList API](/docs/api/summary/get_project_list) |**Yes**|
| **Page** | int | Page number, starting from 0 |**Yes**|
| **NumPerPage** | int | Number of records per page |**Yes**|
| **OrderBy** | string | Sort field, such as BrevityCode means sorting by BrevityCode, used in conjunction with OrderType. Currently supports SendDate, BrevityCode. |**Yes**|
| **OrderType** | string | Sorting method, asc - ascending order desc - descending order |**Yes**|
| **StartDate** | string | Start date, format is YYYY-MM-DD |**Yes**|
| **EndDate** | string | End date, format is YYYY-MM-DD |**Yes**|
| **Domestic** | int | Domestic tag, 0-International SMS 1-Domestic SMS |**Yes**|
| **BrevityCode** | string | International short codes, such as 'CN' represents China. When querying multiple countries, use '-' to separate, such as 'CN-ID'. |No|
| **TemplateId** | string | SMS Template ID |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **Total** | int | Return Record Count |**Yes**|
| **StatisticsData** | [*StatisticsData*](#statisticsdata) | The sum set of sending data statistics that meet the query conditions, see the StatisticsData model for specific field information. |**Yes**|
| **Data** | array[[*TemplateStatisticsDataInfo*](#templatestatisticsdatainfo)] | The collection of send data statistics based on the day as the statistical dimension, the statistical data fields of each day are detailed in the TemplateStatisticsDataInfo model. |No|

#### Data Model


#### StatisticsData

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **UnknownCount** | int | Unknown Status Quantity (Number of Submissions) |**Yes**|
| **SuccessCount** | int | Number of Successful Sendings (Submission Count) |**Yes**|
| **SendCostCount** | int | Total Sent (Split Count) |**Yes**|
| **FailCount** | int | Number of Failed Sendings (Submission Count) |**Yes**|
| **SendCount** | int | Total Sent (Number of Submissions) |**Yes**|
| **SuccessCostCount** | int | Number of Successful Sends (Split Counts) |**Yes**|
| **FailCostCount** | int | Number of Failed Sends (Split Count) |**Yes**|
| **UnknownCostCount** | int | Unknown Status Quantity (Split Count) |**Yes**|
| **SubmitFailCount** | int | Submission Failure Count (Number of Submissions) |**Yes**|
| **SubmitFailCostCount** | int | Submission Failure Count (Split Count) |**Yes**|

#### TemplateStatisticsDataInfo

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **SendDate** | string | Send Time |**Yes**|
| **BrevityCode** | string | International/Regional Identification Code |**Yes**|
| **TemplateId** | string | SMS Template ID |**Yes**|
| **Count** | int | Total Sent (Number of Submissions) |**Yes**|
| **CostCount** | int | Total Sent (Split Count) |**Yes**|
| **SuccessCount** | int | Number of Successful Sendings (Submission Count) |**Yes**|
| **SuccessCostCount** | int | Number of Successful Sends (Split Counts) |**Yes**|
| **FailedCount** | int | Number of Failed Sendings (Submission Count) |**Yes**|
| **FailedCostCount** | int | Number of Failed Sends (Split Count) |**Yes**|
| **UnknownCount** | int | Unknown Status Quantity (Number of Submissions) |**Yes**|
| **UnknownCostCount** | int | Unknown Status Quantity (Split Count) |**Yes**|
| **SubmitFailedCount** | int | Submission Failure Count (Number of Submissions) |**Yes**|
| **SubmitFailedCostCount** | int | Submission Failure Count (Split Count) |**Yes**|

## Example

### Request Example
    
```
https://api.scloudsg.com/?Action=GetUSMSTemplateSendStatistics
&ProjectId=NisAYPmv
&Page=5
&NumPerPage=5
&OrderBy=jOdlouXH
&OrderType=umirvnPn
&StartDate=pkwNCtsO
&EndDate=fOEqzdNm
&Domestic=5
&BrevityCode=sXFqlpJN
&TemplateId=frUFWoVs
```

### Response Example
    
```json
{
  "Action": "GetUSMSTemplateSendStatisticsResponse",
  "Data": [
    {
      "BrevityCode": "kbBFlxEg",
      "CostCount": 1,
      "Count": 9,
      "FailedCostCount": 3,
      "FailedCount": 7,
      "SendDate": "aGQopQIl",
      "SubmitFailedCostCount": 1,
      "SubmitFailedCount": 7,
      "SuccessCostCount": 4,
      "SuccessCount": 4,
      "TemplateId": "JelSfPNU",
      "UnknownCostCount": 6,
      "UnknownCount": 3
    }
  ],
  "Message": "iCneNUGy",
  "RetCode": 0,
  "StatisticsData": {},
  "Total": 2
}
```





