Azure Communication Services — zdarzenia telefonii i wiadomości SMS

Ten artykuł zawiera właściwości i schemat dla usług komunikacyjnych telefonii i zdarzeń SMS. Aby zapoznać się z wprowadzeniem do schematów zdarzeń, zobacz Azure Event Grid schemat zdarzeń.

Typy zdarzeń

Azure Communication Services emituje następujące typy zdarzeń telefonii i wiadomości SMS:

Typ zdarzenia Opis
Microsoft.Communication.SMSReceived Opublikowany po odebraniu wiadomości SMS za pomocą numeru telefonu skojarzonego z usługą komunikacji.
Microsoft.Communication.SMSDeliveryReportReceived Opublikowany po odebraniu raportu dostawy dla wiadomości SMS wysyłanej przez usługę komunikacji.

Odpowiedzi na zdarzenia

Po wyzwoleniu zdarzenia usługa Event Grid wysyła dane dotyczące tego zdarzenia do subskrybowania punktów końcowych.

Ta sekcja zawiera przykładowy wygląd tych danych dla każdego zdarzenia.

Zdarzenie 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"
}]

Uwaga

Możliwe wartości DeliveryStatus to Delivered i Failed.

Zdarzenie Microsoft.Communication.SMSReceived

[{
  "id": "Incoming_20200918002745d29ebbea-3341-4466-9690-0a03af35228e",
  "topic": "/subscriptions/50ad1522-5c2c-4d9a-a6c8-67c11ecb75b8/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"
}]

Następne kroki

Zobacz następujący samouczek: Szybki start: obsługa zdarzeń sms i raportów dostarczania.