Bagikan melalui


Azure Communication Services - Peristiwa SMS

Artikel ini menyediakan properti dan skema untuk peristiwa SMS layanan komunikasi. Untuk pengantar skema peristiwa, lihat Skema peristiwa Azure Event Grid.

Jenis peristiwa

Azure Communication Services memancarkan jenis peristiwa SMS berikut:

Jenis peristiwa Deskripsi
Microsoft.Communication.SMSReceived Dipublikasikan saat SMS diterima melalui nomor telepon yang terkait dengan Communication Service.
Microsoft.Communication.SMSDeliveryReportReceived Diterbitkan saat laporan pengiriman diterima untuk SMS yang dikirim oleh Communication Services.

Tanggapan peristiwa

Ketika suatu peristiwa dipicu, layanan Event Grid akan mengirim data tentang peristiwa itu ke titik akhir.

Bagian ini berisi contoh tampilan data tersebut untuk setiap kejadian.

Peristiwa Microsoft.Communication.SMSDeliveryReportReceived

[{
  "id": "Outgoing_202009180022138813a09b-0cbf-4304-9b03-1546683bb910",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/microsoft.communication/communicationservices/{communication-services-resource-name}",
  "subject": "/phonenumber/15555555555",
  "data": {
    "messageId": "Outgoing_202009180022138813a09b-0cbf-4304-9b03-1546683bb910",
    "from": "15555555555",
    "to": "+15555555555",
    "deliveryStatus": "Delivered",
    "deliveryStatusDetails": "No error.",
    "receivedTimestamp": "2020-09-18T00:22:20.2855749Z",
    "deliveryAttempts": [
      {
        "timestamp": "2020-09-18T00:22:14.9315918Z",
        "segmentsSucceeded": 1,
        "segmentsFailed": 0
      }
    ],
    "Tag": "Optional customer-tag set in the original message"
  },
  "eventType": "Microsoft.Communication.SMSDeliveryReportReceived",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2020-09-18T00:22:20Z"
}]

Catatan

Nilai yang mungkin untuk DeliveryStatus adalah Delivered dan Failed.

Microsoft.Communication.SMSReceived

[{
  "id": "Incoming_20200918002745d29ebbea-3341-4466-9690-0a03af35228e",
  "topic": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/acse2e/providers/microsoft.communication/communicationservices/{communication-services-resource-name}",
  "subject": "/phonenumber/15555555555",
  "data": {
    "messageId": "Incoming_20200918002745d29ebbea-3341-4466-9690-0a03af35228e",
    "from": "15555555555",
    "to": "15555555555",
    "message": "Great to connect with Azure Communication Services events",
    "receivedTimestamp": "2020-09-18T00:27:45.32Z",
    "segmentCount": 1
  },
  "eventType": "Microsoft.Communication.SMSReceived",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2020-09-18T00:27:47Z"
}]

Langkah berikutnya

Lihat tutorial berikut:Mulai Cepat: Menangani sms dan peristiwa laporan pengiriman.