Get advanced analytics metrics
Retrieves advanced analytics metrics based on the specified parameters. You can retrieve either daily or monthly metrics using the time_dimension
parameter.
Note: Daily metrics are calculated and updated every three hours, starting at 1 a.m. in UTC. Meanwhile, monthly metrics are calculated after the last day of the month.
HTTP request
Parameters
The following table lists the parameters that this action supports.
Parameters
Required | Type | Description |
---|---|---|
metric_type | string | Specifies a metric to retrieve, in accordance with the required and optional parameters. Acceptable values are the following: |
time_dimension | string | Specifies the time range of the metric. Acceptable values are daily and monthly. For both daily and monthly metrics, |
start_year | int | Specifies the start year of the metric's time range, in YYYY format. |
end_year | int | Specifies the end year of the metric's time range, in YYYY format. |
start_month | int | Specifies the start month of the metric's time range as an integer from 1 to 12, inclusive. |
end_month | int | Specifies the end month of the metric's time range as an integer from 1 to 12, inclusive. |
Optional | Type | Description |
---|---|---|
limit | int | Specifies the number of results to return per page. Acceptable values range from 1 to 1,000, inclusive. (Default: 1,000) |
token | string | Specifies a page token that indicates the starting index of a chunk of results to retrieve. If not specified, the index is set as 0. |
segments | string | Specifies by what groups to divide the metrics. Acceptable values are channel_type, custom_channel_type, and custom_message_type. These values are effective only when the |
start_day | int | Specifies the start day of the metric's time range as an integer from 1 to 31, inclusive. This parameter should be specified in conjunction with the |
end_day | int | Specifies the end day of the metric's time range as an integer from 1 to 31, inclusive. This parameter should be specified in conjunction with the |
export_as_csv | boolean | Determines whether to export the metric as a CSV file instead of including it in the response. If set to true, the response includes the URL to download the exported file. (Default: false) |
Response
If successful, this action returns a list of an advanced analytics data in the response body.
Note: If the number of custom channel types or custom message types exceeds 400, this action returns only
values
whose custom_channel_type or custom_message_type has a value of null.
Also when theexport_as_csv
parameter is set to true, the response body includes an URL for the file. Meanwhile, specifyingsegments
for the other seven metrics may return an error.
When metric_type
is messages and segments
is channel_type, the values include information on which channel type the data belongs to.
List of response properties
Property name | Type | Description |
---|---|---|
metric_type | string | The retrieved metric. |
segments | array | The array of one or more data types that are retrieved on the metrics. |
values | list | The list of Advanced analytics data that match the specified parameters. |
next | string | The value that can be used in the |
In the case of an error, an error object is returned. A detailed list of error codes is available here.