Bagikan melalui


Azure Communication Services - Peristiwa telepon dan SMS

Artikel ini menyediakan properti dan skema untuk layanan komunikasi peristiwa telepon dan SMS. Untuk pengenalan skema kejadian, lihat skema kejadian Azure Event Grid.

Jenis peristiwa

Azure Communication Services mengeluarkan jenis peristiwa telepon dan SMS berikut ini:

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 peristiwa.

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"
  },
  "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.