Pinpoint / Client / get_in_app_messages

get_in_app_messages#

Pinpoint.Client.get_in_app_messages(**kwargs)#

Retrieves the in-app messages targeted for the provided endpoint ID.

See also: AWS API Documentation

Request Syntax

response = client.get_in_app_messages(
    ApplicationId='string',
    EndpointId='string'
)
Parameters:
  • ApplicationId (string) –

    [REQUIRED]

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

  • EndpointId (string) –

    [REQUIRED]

    The unique identifier for the endpoint.

Return type:

dict

Returns:

Response Syntax

{
    'InAppMessagesResponse': {
        'InAppMessageCampaigns': [
            {
                'CampaignId': 'string',
                'DailyCap': 123,
                'InAppMessage': {
                    'Content': [
                        {
                            'BackgroundColor': 'string',
                            'BodyConfig': {
                                'Alignment': 'LEFT'|'CENTER'|'RIGHT',
                                'Body': 'string',
                                'TextColor': 'string'
                            },
                            'HeaderConfig': {
                                'Alignment': 'LEFT'|'CENTER'|'RIGHT',
                                'Header': 'string',
                                'TextColor': 'string'
                            },
                            'ImageUrl': 'string',
                            'PrimaryBtn': {
                                'Android': {
                                    'ButtonAction': 'LINK'|'DEEP_LINK'|'CLOSE',
                                    'Link': 'string'
                                },
                                'DefaultConfig': {
                                    'BackgroundColor': 'string',
                                    'BorderRadius': 123,
                                    'ButtonAction': 'LINK'|'DEEP_LINK'|'CLOSE',
                                    'Link': 'string',
                                    'Text': 'string',
                                    'TextColor': 'string'
                                },
                                'IOS': {
                                    'ButtonAction': 'LINK'|'DEEP_LINK'|'CLOSE',
                                    'Link': 'string'
                                },
                                'Web': {
                                    'ButtonAction': 'LINK'|'DEEP_LINK'|'CLOSE',
                                    'Link': 'string'
                                }
                            },
                            'SecondaryBtn': {
                                'Android': {
                                    'ButtonAction': 'LINK'|'DEEP_LINK'|'CLOSE',
                                    'Link': 'string'
                                },
                                'DefaultConfig': {
                                    'BackgroundColor': 'string',
                                    'BorderRadius': 123,
                                    'ButtonAction': 'LINK'|'DEEP_LINK'|'CLOSE',
                                    'Link': 'string',
                                    'Text': 'string',
                                    'TextColor': 'string'
                                },
                                'IOS': {
                                    'ButtonAction': 'LINK'|'DEEP_LINK'|'CLOSE',
                                    'Link': 'string'
                                },
                                'Web': {
                                    'ButtonAction': 'LINK'|'DEEP_LINK'|'CLOSE',
                                    'Link': 'string'
                                }
                            }
                        },
                    ],
                    'CustomConfig': {
                        'string': 'string'
                    },
                    'Layout': 'BOTTOM_BANNER'|'TOP_BANNER'|'OVERLAYS'|'MOBILE_FEED'|'MIDDLE_BANNER'|'CAROUSEL'
                },
                'Priority': 123,
                'Schedule': {
                    'EndDate': 'string',
                    'EventFilter': {
                        'Dimensions': {
                            'Attributes': {
                                'string': {
                                    'AttributeType': 'INCLUSIVE'|'EXCLUSIVE'|'CONTAINS'|'BEFORE'|'AFTER'|'ON'|'BETWEEN',
                                    'Values': [
                                        'string',
                                    ]
                                }
                            },
                            'EventType': {
                                'DimensionType': 'INCLUSIVE'|'EXCLUSIVE',
                                'Values': [
                                    'string',
                                ]
                            },
                            'Metrics': {
                                'string': {
                                    'ComparisonOperator': 'string',
                                    'Value': 123.0
                                }
                            }
                        },
                        'FilterType': 'SYSTEM'|'ENDPOINT'
                    },
                    'QuietTime': {
                        'End': 'string',
                        'Start': 'string'
                    }
                },
                'SessionCap': 123,
                'TotalCap': 123,
                'TreatmentId': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) –

    The request succeeded.

    • InAppMessagesResponse (dict) –

      Get in-app messages response object.

      • InAppMessageCampaigns (list) –

        List of targeted in-app message campaigns.

        • (dict) –

          Targeted in-app message campaign.

          • CampaignId (string) –

            Campaign id of the corresponding campaign.

          • DailyCap (integer) –

            Daily cap which controls the number of times any in-app messages can be shown to the endpoint during a day.

          • InAppMessage (dict) –

            In-app message content with all fields required for rendering an in-app message.

            • Content (list) –

              In-app message content.

              • (dict) –

                The configuration for the message content.

                • BackgroundColor (string) –

                  The background color for the message.

                • BodyConfig (dict) –

                  The configuration for the message body.

                  • Alignment (string) –

                    The alignment of the text. Valid values: LEFT, CENTER, RIGHT.

                  • Body (string) –

                    Message Body.

                  • TextColor (string) –

                    The text color.

                • HeaderConfig (dict) –

                  The configuration for the message header.

                  • Alignment (string) –

                    The alignment of the text. Valid values: LEFT, CENTER, RIGHT.

                  • Header (string) –

                    Message Header.

                  • TextColor (string) –

                    The text color.

                • ImageUrl (string) –

                  The image url for the background of message.

                • PrimaryBtn (dict) –

                  The first button inside the message.

                  • Android (dict) –

                    Default button content.

                    • ButtonAction (string) –

                      Action triggered by the button.

                    • Link (string) –

                      Button destination.

                  • DefaultConfig (dict) –

                    Default button content.

                    • BackgroundColor (string) –

                      The background color of the button.

                    • BorderRadius (integer) –

                      The border radius of the button.

                    • ButtonAction (string) –

                      Action triggered by the button.

                    • Link (string) –

                      Button destination.

                    • Text (string) –

                      Button text.

                    • TextColor (string) –

                      The text color of the button.

                  • IOS (dict) –

                    Default button content.

                    • ButtonAction (string) –

                      Action triggered by the button.

                    • Link (string) –

                      Button destination.

                  • Web (dict) –

                    Default button content.

                    • ButtonAction (string) –

                      Action triggered by the button.

                    • Link (string) –

                      Button destination.

                • SecondaryBtn (dict) –

                  The second button inside message.

                  • Android (dict) –

                    Default button content.

                    • ButtonAction (string) –

                      Action triggered by the button.

                    • Link (string) –

                      Button destination.

                  • DefaultConfig (dict) –

                    Default button content.

                    • BackgroundColor (string) –

                      The background color of the button.

                    • BorderRadius (integer) –

                      The border radius of the button.

                    • ButtonAction (string) –

                      Action triggered by the button.

                    • Link (string) –

                      Button destination.

                    • Text (string) –

                      Button text.

                    • TextColor (string) –

                      The text color of the button.

                  • IOS (dict) –

                    Default button content.

                    • ButtonAction (string) –

                      Action triggered by the button.

                    • Link (string) –

                      Button destination.

                  • Web (dict) –

                    Default button content.

                    • ButtonAction (string) –

                      Action triggered by the button.

                    • Link (string) –

                      Button destination.

            • CustomConfig (dict) –

              Custom config to be sent to SDK.

              • (string) –

                • (string) –

            • Layout (string) –

              The layout of the message.

          • Priority (integer) –

            Priority of the in-app message.

          • Schedule (dict) –

            Schedule of the campaign.

            • EndDate (string) –

              The scheduled time after which the in-app message should not be shown. Timestamp is in ISO 8601 format.

            • EventFilter (dict) –

              The event filter the SDK has to use to show the in-app message in the application.

              • Dimensions (dict) –

                The dimension settings of the event filter for the campaign.

                • Attributes (dict) –

                  One or more custom attributes that your application reports to Amazon Pinpoint. You can use these attributes as selection criteria when you create an event filter.

                  • (string) –

                    • (dict) –

                      Specifies attribute-based criteria for including or excluding endpoints from a segment.

                      • AttributeType (string) –

                        The type of segment dimension to use. Valid values are:

                        • INCLUSIVE - endpoints that have attributes matching the values are included in the segment.

                        • EXCLUSIVE - endpoints that have attributes matching the values are excluded in the segment.

                        • CONTAINS - endpoints that have attributes’ substrings match the values are included in the segment.

                        • BEFORE - endpoints with attributes read as ISO_INSTANT datetimes before the value are included in the segment.

                        • AFTER - endpoints with attributes read as ISO_INSTANT datetimes after the value are included in the segment.

                        • ON - endpoints with attributes read as ISO_INSTANT dates on the value are included in the segment. Time is ignored in this comparison.

                        • BETWEEN - endpoints with attributes read as ISO_INSTANT datetimes between the values are included in the segment.

                      • Values (list) –

                        The criteria values to use for the segment dimension. Depending on the value of the AttributeType property, endpoints are included or excluded from the segment if their attribute values match the criteria values.

                        • (string) –

                • EventType (dict) –

                  The name of the event that causes the campaign to be sent or the journey activity to be performed. This can be a standard event that Amazon Pinpoint generates, such as _email.delivered. For campaigns, this can also be a custom event that’s specific to your application. For information about standard events, see Streaming Amazon Pinpoint Events in the Amazon Pinpoint Developer Guide.

                  • DimensionType (string) –

                    The type of segment dimension to use. Valid values are: INCLUSIVE, endpoints that match the criteria are included in the segment; and, EXCLUSIVE, endpoints that match the criteria are excluded from the segment.

                  • Values (list) –

                    The criteria values to use for the segment dimension. Depending on the value of the DimensionType property, endpoints are included or excluded from the segment if their values match the criteria values.

                    • (string) –

                • Metrics (dict) –

                  One or more custom metrics that your application reports to Amazon Pinpoint. You can use these metrics as selection criteria when you create an event filter.

                  • (string) –

                    • (dict) –

                      Specifies metric-based criteria for including or excluding endpoints from a segment. These criteria derive from custom metrics that you define for endpoints.

                      • ComparisonOperator (string) –

                        The operator to use when comparing metric values. Valid values are: GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL, and EQUAL.

                      • Value (float) –

                        The value to compare.

              • FilterType (string) –

                The type of event that causes the campaign to be sent. Valid values are: SYSTEM, sends the campaign when a system event occurs; and, ENDPOINT, sends the campaign when an endpoint event (Events resource) occurs.

            • QuietTime (dict) –

              Time during which the in-app message should not be shown to the user.

              • End (string) –

                The specific time when quiet time ends. This value has to use 24-hour notation and be in HH:MM format, where HH is the hour (with a leading zero, if applicable) and MM is the minutes. For example, use 02:30 to represent 2:30 AM, or 14:30 to represent 2:30 PM.

              • Start (string) –

                The specific time when quiet time begins. This value has to use 24-hour notation and be in HH:MM format, where HH is the hour (with a leading zero, if applicable) and MM is the minutes. For example, use 02:30 to represent 2:30 AM, or 14:30 to represent 2:30 PM.

          • SessionCap (integer) –

            Session cap which controls the number of times an in-app message can be shown to the endpoint during an application session.

          • TotalCap (integer) –

            Total cap which controls the number of times an in-app message can be shown to the endpoint.

          • TreatmentId (string) –

            Treatment id of the campaign.

Exceptions