本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
故障診斷
注意
熟悉疑難排解資訊和可能的解決方案,有助於解決使用 Amazon Pinpoint 時發生的問題。
監控和記錄
最佳作法是透過以下方式在 Amazon Pinpoint 中記錄事件:
-
Amazon Kinesis Data Streams 按照 中的指示開啟事件串流透過 Amazon Pinpoint 串流事件。
-
使用自訂記錄解決方案。詳情請參閱數位使用者互動事件資料庫
。涉及多項服務,並產生額外費用。 -
使用 Amazon Pinpoint 支援的 Amazon CloudWatch 指標。如需詳細資訊,請參閱使用 Amazon 監控 Amazon Pinpoint CloudWatch。
-
使用記錄在 CloudTrail 中的 Amazon Pinpoint API 呼叫。詳情請參閱《Amazon Pinpoint 開發人員指南》中的記錄 Amazon Pinpoint API 呼叫 AWS CloudTrail。
常見任務的 CLI 範例
以下範例是 Amazon Pinpoint 的常見 CLI 命令。
-
取得端點資料:get-endpoint CLI
aws pinpoint get-endpoint —application-id
AppId
—endpoint-idEndpointId
在上述命令中,進行下列變更:
-
將
AppId
替換成包含該端點的 Amazon Pinpoint 專案的 ID。 -
將
EndpointId
替換成您要擷取的現有端點的 ID。
-
-
取得使用者資料:get-user-endpoints CLI
aws pinpoint get-user-endpoints —application-id
AppId
—user-idUserId
在上述命令中,進行下列變更:
-
將
AppId
替換成包含該端點的 Amazon Pinpoint 專案的 ID。 -
將
UserId
替換成使用者的 ID。
-
-
更新或建立新端點:update-endpoint CLI
aws pinpoint update-endpoint —application-id
AppId
—endpoint-idEndpointId
—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-idEndpointId
在上述命令中,進行下列變更:
-
將
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。
-