Skip to content
Last updated

Retrieving delivery reports with the .NET SDK

Note:

For testing purposes, we recommend you first send a message using the Getting Started Guide. Alternatively, you can test this method using the provided code sample.

Retrieve a delivery report for a specific recipient

The GetForNumber method retrieves a delivery report by phone number as well as batch ID.

var deliveryReportForNumber = await sinch.Sms.DeliveryReports.GetForNumber(response.Id, "YOUR_recipient_phone_number");

Display the result using:

Console.WriteLine(deliveryReportForNumber);

When you run it, you should see an output like the following:

{
  "At": "2024-10-25T08:43:49.352Z",
  "BatchId": "01JB1DH7J0DHQCZ37DAHZYH7JH",
  "Code": 401,
  "Status": "Dispatched",
  "AppliedOriginator": null,
  "ClientReference": null,
  "NumberOfMessageParts": null,
  "Operator": null,
  "OperatorStatusAt": null,
  "Type": "recipient_delivery_report_sms"
}

The response contains a number of useful fields:

  • At is a timestamp of when a delivery report was created
  • Code is the delivery report error code
  • Status is the delivery status of a message

This information can help you ascertain whether a person successfully recieved a message, as well as allowing you to drill down into causes of failure.

See more delivery report tutorials