故障排除 - Amazon Pinpoint

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

故障排除

请熟悉问题排查信息和可能的解决方案,这将有助于您解决在使用 Amazon Pinpoint 时遇到的问题。

监控和日志记录

作为最佳实践,请考虑通过以下方式在 Amazon Pinpoint 中记录事件:

常见任务的 CLI 示例

以下示例是 Amazon Pinpoint 的常用 CLI 命令。

  • 获取端点数据:get-endpoint CLI

    aws pinpoint get-endpoint —application-id AppId —endpoint-id EndpointId
    在前面的命令中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • EndpointId替换为您正在检索的现有端点的 ID。

  • 获取用户数据:get-user-endpointsCLI

    aws pinpoint get-user-endpoints —application-id AppId —user-id UserId
    在前面的命令中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • UserId替换为用户的 ID。

  • 更新或创建新端点:update-endpoint CLI

    aws pinpoint update-endpoint —application-id AppId —endpoint-id EndpointId —endpoint-request '{"ChannelType":"SMS","Address":"+12345678","Location":{"Country":"USA"},"User":{"UserId":"UserId"}}'
    在前面的命令中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • EndpointId替换为您正在创建或更新的现有终端节点的 ID。

    • UserId替换为用户的 ID。

  • 删除端点:delete-endpoint CLI

    aws pinpoint delete-endpoint —application-id AppId —endpoint-id EndpointId
    在前面的命令中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • EndpointId替换为您要删除的现有终端节点的 ID。

  • 验证电话号码:phone-number-validateCLI

    aws pinpoint phone-number-validate —number-validate-request PhoneNumber=+12065550100
    在前面的命令中,进行以下更改:
    • +12065550100 替换为要验证的电话号码。

  • send-messages 示例 CLI:短信发往号码

    aws pinpoint send-messages --application-id AppID --message-request '{"MessageConfiguration": {"SMSMessage":{"Body":"This is a test message"}},"Addresses": {"DestinationPhoneNumber": {"ChannelType":"SMS"}}}‘
    在前面的命令中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • DestinationPhoneNumber替换为您要发送的电话号码。

  • send-messages 示例 CLI:发起号码发出短信

    aws pinpoint send-messages --application-id AppID --message-request '{"MessageConfiguration": {"SMSMessage":{"Body":"hello, how are you?","OriginationNumber": "OriginPhoneNumber"}},"Addresses": {"DestinationPhoneNumber": {"ChannelType":"SMS"}}}‘
    在前面的命令中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • OriginPhoneNumber替换为您想要发送消息的电话号码。

    • DestinationPhoneNumber替换为您要发送的电话号码。

  • send-messages 示例 CLI:短信发往端点

    aws pinpoint send-messages —application-id AppID —message-request '{"MessageConfiguration": {"SMSMessage":{"Body":"This is a test message"}},"Endpoints": {"EndPointId": {}}}'
    在前面的命令中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • EndPointId替换为您要发送的现有终端节点的 ID。

  • send-messages 示例 CLI:短信发往 userId

    aws pinpoint send-users-messages —application-id AppID —send-users-message-request '{"MessageConfiguration": {"SMSMessage":{"Body":"This is a test"}},"Users": {"UserId": {}}}'
    在前面的命令中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • UserId替换为用户的 ID。

  • 通过 Amazon Pinpoint 消息模板 create-campaign CLI 创建活动

    aws pinpoint create-campaign —application-id AppId —write-campaign-request file://campaignclirequest.json file://campaignclirequest.json { "Description": "CLITestCampaign", "HoldoutPercent": 0, "MessageConfiguration": { "DefaultMessage": { "Body": "TestFromCLI" } }, "Name": "TestingCLICampaign", "Schedule": { "StartTime": "IMMEDIATE" }, "TemplateConfiguration": { "EmailTemplate": { "Name": "TemplateName", "Version": "Version" } }, "SegmentId": "SegmentID", "SegmentVersion": 1 }
    在前面的命令和文件中,进行以下更改:
    • AppId替换为包含终端节点的 Amazon Pinpoint 项目的编号。

    • TemplateName替换为模板的名称。

    • Version 替换为模板的版本。

    • SegmentID 替换为目标客户细分的 ID。