getForNumber retrieves a delivery report by phone number as well as batch ID.
DeliveryReportRecipient response =
client.sms().deliveryReports().getForNumber(batchId, phoneNumber);When you run it, you should see an output like the following:
DeliveryReportRecipientSMS{} DeliveryReportRecipient{
at=2024-06-07T12:27:20.746Z, code='401', recipient='447...',
status=Dispatched, appliedOriginator='null', encoding='null',
numberOfMessageParts=null, operator='null', operatorStatusAt=null}
BaseDeliveryReport{batchId='01H...', clientReference='null'}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 received 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