故障診斷 - 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 專案的 ID。

    • EndpointId 替換成您要擷取的現有端點的 ID。

  • 取得使用者資料:get-user-endpoints CLI

    aws pinpoint get-user-endpoints —application-id AppId —user-id UserId
    在上述命令中,進行下列變更:
    • AppId 替換成包含該端點的 Amazon Pinpoint 專案的 ID。

    • 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 專案的 ID。

    • EndpointId 替換成您要建立或更新的現有端點的 ID。

    • UserId 替換成使用者的 ID。

  • 刪除端點:delete-endpoint CLI

    aws pinpoint delete-endpoint —application-id AppId —endpoint-id EndpointId
    在上述命令中,進行下列變更:
    • AppId 替換成包含該端點的 Amazon Pinpoint 專案的 ID。

    • EndpointId 替換成您要刪除的現有端點的 ID。

  • 驗證電話號碼:phone-number-validate CLI

    aws pinpoint phone-number-validate —number-validate-request PhoneNumber=+12065550100
    在上述命令中,進行下列變更:
    • 在前述命令中,將 +12065550100 替換成您要驗證的電話號碼。

  • send-messages 範例 CLI:SMS 到號碼

    aws pinpoint send-messages --application-id AppID --message-request '{"MessageConfiguration": {"SMSMessage":{"Body":"This is a test message"}},"Addresses": {"DestinationPhoneNumber": {"ChannelType":"SMS"}}}‘
    在上述命令中,進行下列變更:
    • AppId 替換成包含該端點的 Amazon Pinpoint 專案的 ID。

    • DestinationPhoneNumber 替換成目的地的電話號碼。

  • send-messages 範例 CLI:起始號碼到 SMS

    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 專案的 ID。

    • OriginPhoneNumber 替換成您要傳送訊息的來源電話號碼。

    • DestinationPhoneNumber 替換成目的地的電話號碼。

  • send-messages 範例 CLI:SMS 到端點

    aws pinpoint send-messages —application-id AppID —message-request '{"MessageConfiguration": {"SMSMessage":{"Body":"This is a test message"}},"Endpoints": {"EndPointId": {}}}'
    在上述命令中,進行下列變更:
    • AppId 替換成包含該端點的 Amazon Pinpoint 專案的 ID。

    • EndPointId 替換成目的地的現有端點的 ID。

  • send-messages 範例 CLI:SMS 到 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 專案的 ID。

    • 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 專案的 ID。

    • TemplateName 替換成範本的名稱。

    • 版本替換成範本的版本。

    • SegmentID 替換成要鎖定的客群的 ID。