

**支援終止通知：**2026 年 10 月 30 日， AWS 將結束對 Amazon Pinpoint 的支援。2026 年 10 月 30 日之後，您將無法再存取 Amazon Pinpoint 主控台或 Amazon Pinpoint 資源 (端點、區段、行銷活動、旅程和分析)。如需詳細資訊，請參閱 [Amazon Pinpoint 終止支援](https://docs.aws.amazon.com/console/pinpoint/migration-guide)。**注意：**與 SMS、語音、行動推播、OTP 和電話號碼驗證相關的 APIs 不受此變更影響，並受 AWS 最終使用者傳訊支援。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 來自 Amazon Pinpoint 的簡訊事件資料串流
<a name="event-streams-data-sms"></a>

如果為專案啟用了 SMS 管道，Amazon Pinpoint 可以針對為該專案傳送的 SMS 訊息，串流事件資料。設定事件串流之後，Amazon Pinpoint 會從您在設定期間指定的目的地擷取事件資料，供您檢視。如需如何設定事件串流的資訊，請參閱 [設定 Amazon Pinpoint 透過 Amazon Kinesis 或 Amazon Data Firehose 串流應用程式事件資料](event-streams-setup.md)。

**注意**  
電信業者產生的簡訊事件最多可能需要 72 小時才會收到，不應用於判斷傳出訊息傳遞是否有延遲。72 小時後，如果 Amazon Pinpoint 尚未收到電信業者的最終事件，服務會自動傳回 UNKNOWN record\$1status，因為 Amazon Pinpoint 不知道該訊息發生了什麼情況。

## SMS 事件範例
<a name="event-streams-data-sms-example"></a>

簡訊事件的 JSON 物件包含以下範例所示的資料。

```
{
  "event_type": "_SMS.SUCCESS",
  "event_timestamp": 1553104954322,
  "arrival_timestamp": 1553104954064,
  "event_version": "3.1",
  "application": {
    "app_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
    "sdk": {}
  },
  "client": {
    "client_id": "123456789012"
  },
  "device": {
    "platform": {}
  },
  "session": {},
  "attributes": {
    "sender_request_id": "565d4425-4b3a-11e9-b0a5-example",
    "campaign_activity_id": "cbcfc3c5e3bd48a8ae2b9cb41example",
    "origination_phone_number": "+12065550142",
    "destination_phone_number": "+14255550199",
    "record_status": "DELIVERED",
    "iso_country_code": "US",
    "treatment_id": "0",
    "number_of_message_parts": "1",
    "message_id": "1111-2222-3333",
    "message_type": "Transactional",
    "campaign_id": "52dc44b35c4742c98c5935269example"
    "customer_context": "{\"userId\":\"user-id-4\"}"
  },
  "metrics": {
    "price_in_millicents_usd": 645.0
  },
  "awsAccountId": "123456789012"
}
```

## 簡訊事件屬性
<a name="event-streams-data-sms-attributes"></a>

本節定義 Amazon Pinpoint 在您傳送簡訊時產生事件串流資料先前範例中包含的屬性。


**事件**  

| 屬性 | 描述 | 
| --- | --- | 
| event\$1type |  事件的類型。可能值為： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/pinpoint/latest/developerguide/event-streams-data-sms.html)  | 
| event\$1timestamp | 報告事件的時間，以 Unix 時間顯示 (毫秒)。 | 
| arrival\$1timestamp | Amazon Pinpoint 收到事件的時間，顯示為 Unix 時間 (以毫秒為單位)。 | 
| event\$1version |  事件 JSON 結構描述的版本。  在您的事件處理應用程式中檢查此版本，讓您知道何時更新應用程式以回應結構描述更新。   | 
| application | 與事件相關聯的 Amazon Pinpoint 專案的資訊。如需詳細資訊，請參閱[應用程式](#event-streams-data-sms-attributes-application)表。 | 
| client | 回報事件的裝置中安裝的應用程式用戶端相關資訊。如需詳細資訊，請參閱[用戶端](#event-streams-data-sms-attributes-client)表。 | 
| device | 回報事件的裝置資訊。如需詳細資訊，請參閱[裝置](#event-streams-data-sms-attributes-device)表。 若為簡訊事件，此物件為空。 | 
| session | 若為簡訊事件，此物件為空。 | 
| attributes |  與事件相關聯的屬性。若為您應用程式之一所報告的事件，此物件可包含由應用程式定義的自訂屬性。若為您傳送行銷活動時所建立的事件，此物件可包含與行銷活動相關聯的屬性。若為您傳送交易訊息時所產生的事件，此物件可包含訊息本身的相關資訊。 如需詳細資訊，請參閱[屬性](#event-streams-data-sms-attributes-attrs)表。  | 
| metrics |  與事件相關聯的其他指標。如需詳細資訊，請參閱[指標](#event-streams-data-sms-attributes-metrics)表。  | 
| awsAccountId |  用來傳送訊息 AWS 的帳戶 ID。  | 

### 應用程式
<a name="event-streams-data-sms-attributes-application"></a>

包含與事件相關聯的 Amazon Pinpoint 專案的資訊，以及用於回報事件的 SDK (如果有的話)。


| 屬性 | 描述 | 
| --- | --- | 
| app\$1id |  回報事件的 Amazon Pinpoint 專案的唯一 ID。  | 
| sdk |  過去用來報告事件的開發套件。如果您透過直接呼叫 Amazon Pinpoint API 或使用 Amazon Pinpoint 主控台傳送交易 SMS 訊息，此物件會是空的。  | 

### Attributes
<a name="event-streams-data-sms-attributes-attrs"></a>

包含與事件相關聯的屬性資訊。


| 屬性 | 描述 | 
| --- | --- | 
| sender\$1request\$1id | 與傳送簡訊請求相關聯的唯一 ID。 | 
| campaign\$1activity\$1id | 行銷活動內的活動唯一 ID。 | 
| origination\$1phone\$1number |  訊息傳送來源的電話號碼。  | 
| destination\$1phone\$1number |  您嘗試傳送訊息的電話號碼。  | 
| record\$1status |  訊息狀態的其他資訊。可能的值包括： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/pinpoint/latest/developerguide/event-streams-data-sms.html)  | 
| iso\$1country\$1code |  與收件人電話號碼相關聯的國家，以 ISO 3166-1 alpha-2 格式顯示。  | 
| treatment\$1id |  訊息處理方式的 ID (如果已使用 A/B 行銷活動傳送訊息)。  | 
| treatment\$1id |  如果訊息曾使用 A/B 測試行銷活動傳送，則此值代表訊息的處理方式號碼。若為交易簡訊，此值為 0。  | 
| number\$1of\$1message\$1parts |  Amazon Pinpoint 為傳送訊息而建立的訊息部分數。 一般而言，簡訊只能包含 160 個 GSM-7 字元或 67 個非 GSM 字元，但這些限制會因國家而異。如果您傳送的訊息超過這些限制，Amazon Pinpoint 會自動將訊息分割成較小的部分。收費依傳送的訊息片段數量為準。  | 
| message\$1id |  Amazon Pinpoint 接受訊息時，產生的唯一 ID。  | 
| message\$1type |  訊息的類型。可能的值為 **Promotional (促銷)** 和 **Transactional (交易)**。您可以在建立行銷活動時，或使用 Amazon Pinpoint API 中的 [SendMessages](https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-messages.html#SendMessages) 操作時指定此值。  | 
| campaign\$1id |  傳送訊息的 Amazon Pinpoint 行銷活動的唯一 ID。  | 
| customer\$1context | 來自 Amazon Pinpoint [SendMessages](https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-messages.html#SendMessages) 操作中傳送之`Context`映射內容的 JSON 字串。 | 

### 用戶端
<a name="event-streams-data-sms-attributes-client"></a>

包含回報事件之裝置上安裝的應用程式用戶端資訊。


| 屬性 | 描述 | 
| --- | --- | 
| client\$1id |  若為應用程式產生的事件，則此值會是安裝在裝置上的應用程式用戶端唯一 ID。此 ID 由 AWS Mobile SDK for iOS 和 自動產生 適用於 Android 的 AWS Mobile SDK。 若為傳送行銷活動和交易訊息時產生的事件，此值等於您訊息傳送目標的端點 ID。  | 
| cognito\$1id | 這個唯一 ID 已指派給您應用程式使用的 Amazon Cognito 身分池中的應用程式用戶端。 | 

### 裝置
<a name="event-streams-data-sms-attributes-device"></a>

包含回報事件的裝置資訊。


| 屬性 | 描述 | 
| --- | --- | 
| locale | 裝置地區設定。 | 
| make | 裝置品牌，例如 Apple 或 Samsung。 | 
| model | 裝置型號，例如 iPhone。 | 
| platform | 裝置平台，例如 ios 或 android。 | 

### 指標
<a name="event-streams-data-sms-attributes-metrics"></a>

包含與事件相關聯的指標資訊。


| 屬性 | 描述 | 
| --- | --- | 
| price\$1in\$1millicents\$1usd | 我們向您收取的傳訊費金額。此價格以千分之多少美國分顯示。假設此屬性的值是 `645`，則我們收取的傳訊費用是 0.645¢ (645/1000 = 0.645¢ = \$10.00645)。  此屬性不會針對 `event_type` 為 **\$1SMS.BUFFERED** 的訊息顯示。   | 