Amazon Pinpoint
REST API Reference

Application Metrics

An application metric is a measurable value, also referred to as a key performance indicator (KPI), that can help you monitor and assess trends related to user engagement, campaign outreach, and more for an application. For example, you can use an application metric to see a breakdown of the number of campaign messages that were opened by recipients for each campaign that's associated with an Amazon Pinpoint application. Amazon Pinpoint automatically collects, aggregates, and stores this data for all of your applications. If you integrated a mobile app with Amazon Pinpoint by using an AWS Mobile SDK, Amazon Pinpoint extends this support to include additional metrics, such as a breakdown of the percentage of push notifications that were opened by recipients of each campaign. For information about integrating a mobile app, see Integrating Amazon Pinpoint with Your Application in the Amazon Pinpoint Developer Guide.

The Application Metrics resource represents a collection of standard metrics that apply to all the campaigns for an Amazon Pinpoint application. As part of the Amazon Pinpoint Analytics APIs, this resource provides you with programmatic access to pre-aggregated data for each of these metrics. This means that you can query the data for an application metric by sending a GET request to the Application Metrics URI. In your request, you specify the application, the metric (kpi-name), and the date range that you want to retrieve the data for. Amazon Pinpoint returns the query results in a JSON response and, depending on the metric, groups the results by campaign ID or another relevant field. You can then pass the results to another service or application for deeper analysis, storage, or reporting. For a list of application metrics that are currently supported, see the Amazon Pinpoint Developer Guide.

You can use the Application Metrics resource to retrieve pre-aggregated data for a standard metric that applies to all the campaigns for an application. To retrieve data for a standard metric that applies to only one campaign, use the Campaign Metrics resource.

URI

/v1/apps/application-id/kpis/daterange/kpi-name

HTTP Methods

GET

Operation ID: GetApplicationDateRangeKpi

Retrieves (queries) pre-aggregated data for a standard metric that applies to an application.

Path Parameters

Name Type Required Description
application-id String True

The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.

kpi-name String True

The name of the metric, also referred to as a key performance indicator (KPI), to retrieve data for. This value describes the associated metric and consists of two or more terms, which are comprised of lowercase alphanumeric characters, separated by a hyphen. Examples are email-open-rate and successful-delivery-rate. For a list of valid values, see the Amazon Pinpoint Developer Guide.

Header Parameters

Name Type Required Description
accept String False

Indicates which content types, expressed as MIME types, the client understands.

Query Parameters

Name Type Required Description
next-token String False

The NextToken string that specifies which page of results to return in a paginated response. This parameter is currently not supported by the Application Metrics and Campaign Metrics resources.

end-time String False

The last date and time to retrieve data for, as part of an inclusive date range that filters the query results. This value should be in extended ISO 8601 format, for example: 2019-07-19T00:00:00Z for July 19, 2019 and 2019-07-19T20:00:00Z for 8:00 PM July 19, 2019.

start-time String False

The first date and time to retrieve data for, as part of an inclusive date range that filters the query results. This value should be in extended ISO 8601 format, for example: 2019-07-15T00:00:00Z for July 15, 2019 and 2019-07-15T16:00:00Z for 4:00 PM July 15, 2019.

page-size String False

The maximum number of items to include in each page of a paginated response. This parameter is currently not supported by the Application Metrics and Campaign Metrics resources.

Responses

Status Code Response Model Description
200 ApplicationDateRangeKpiResponse

The request succeeded.

400 MessageBody

The request contains a syntax error (BadRequestException).

403 MessageBody

The request was denied because access to the specified resource is forbidden (ForbiddenException).

404 MessageBody

The request failed because the specified resource was not found (NotFoundException).

405 MessageBody

The request failed because the method is not allowed for the specified resource (MethodNotAllowedException).

429 MessageBody

The request failed because too many requests were sent during a certain amount of time (TooManyRequestsException).

500 MessageBody

The request failed due to an unknown internal server error, exception, or failure (InternalServerErrorException).

OPTIONS

Retrieves information about the communication requirements and options that are available for the Application Metrics resource.

Responses

Status Code Response Model Description
200 None

The request succeeded.

Schemas

Response Bodies

Example ApplicationDateRangeKpiResponse

{ "KpiName": "string", "KpiResult": { "Rows": [ { "GroupedBys": [ { "Key": "string", "Value": "string", "Type": "string" } ], "Values": [ { "Key": "string", "Value": "string", "Type": "string" } ] } ] }, "NextToken": "string", "ApplicationId": "string", "StartTime": "string", "EndTime": "string" }

Example MessageBody

{ "RequestID": "string", "Message": "string" }

Properties

ApplicationDateRangeKpiResponse

Provides the results of a query that retrieved the data for a standard metric that applies to an application, and provides information about that query.

Property Type Required Description
KpiName

string

True

The name of the metric, also referred to as a key performance indicator (KPI), that the data was retrieved for. This value describes the associated metric and consists of two or more terms, which are comprised of lowercase alphanumeric characters, separated by a hyphen. For a list of valid values, see the Amazon Pinpoint Developer Guide.

KpiResult

BaseKpiResult

True

An array of objects that contains the results of the query. Each object contains the value for the metric and metadata about that value.

NextToken

string

False

The string to use in a subsequent request to get the next page of results in a paginated response. This value is null for the Application Metrics resource. The Application Metrics resource returns all results in a single page.

ApplicationId

string

True

The unique identifier for the application that the metric applies to.

StartTime

string

True

The first date and time of the date range that was used to filter the query results, in extended ISO 8601 format. The date range is inclusive.

EndTime

string

True

The last date and time of the date range that was used to filter the query results, in extended ISO 8601 format. The date range is inclusive.

BaseKpiResult

Provides the results of a query that retrieved the data for a standard metric that applies to an application or campaign.

Property Type Required Description
Rows

Array of type ResultRow

True

An array of objects that provides the results of a query that retrieved the data for a standard metric that applies to an application or campaign.

MessageBody

Provides information about an API request or response.

Property Type Required Description
RequestID

string

False

The unique identifier for the request or response.

Message

string

False

The message that's returned from the API.

ResultRow

Provides the results of a query that retrieved the data for a standard metric that applies to an application or campaign.

Property Type Required Description
GroupedBys

Array of type ResultRowValue

True

An array of objects that defines the field and field values that were used to group data in a result set that contains multiple results. This value is null if the data in a result set isn’t grouped.

Values

Array of type ResultRowValue

True

An array of objects that provides pre-aggregated values for a standard metric that applies to an application or campaign.

ResultRowValue

Provides a single value and metadata about that value as part of an array of query results for a standard metric that applies to an application or campaign.

Property Type Required Description
Key

string

True

The name of the field that Amazon Pinpoint uses to store the value specified by the Value property.

Value

string

True

In a Values object, the value for the metric that the query retrieved data for. In a GroupedBys object, the value for the field that was used to group data in a result set that contains multiple results (Values objects).

Type

string

True

The data type of the value specified by the Value property.

See Also

For more information about using this API in one of the language-specific AWS SDKs and references, see the following:

GetApplicationDateRangeKpi