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.
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:
Atis a timestamp of when a delivery report was createdCodeis the delivery report error codeStatusis 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
- Index Page
- Retrieve a delivery report for a batch
- Retrieve a delivery report for a specific recipient
- Retrieve a list of delivery reports