sinch.domains.sms.api.v1.delivery_reports_apis module
- class sinch.domains.sms.api.v1.delivery_reports_apis.DeliveryReports(sinch)[source]
Bases:
BaseSms- get(
- batch_id: str,
- report_type: str | None = None,
- status: List[Literal['QUEUED', 'DISPATCHED', 'ABORTED', 'CANCELLED', 'FAILED', 'DELIVERED', 'EXPIRED', 'REJECTED', 'DELETED', 'UNKNOWN'] | Annotated[str, Strict(strict=True)]] | None = None,
- code: List[Literal[400, 401, 402, 403, 404, 405, 406, 407, 408, 410, 411, 412, 413, 414, 415, 416, 417, 418] | Annotated[int, Strict(strict=True)]] | None = None,
- client_reference: str | None = None,
- **kwargs,
Delivery reports can be retrieved even if no callback was requested. The difference between a summary and a full report is only that the full report contains the phone numbers in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format for each status code.
- Parameters:
batch_id (str) – The batch ID you received from sending a message. (required)
report_type (Optional[str]) – The type of delivery report. - A summary will count the number of messages sent per status. - A full report give that of a summary report but in addition, lists phone numbers. (optional)
status (Optional[List[DeliveryStatusType]]) – Comma separated list of delivery_report_statuses to include (optional)
code (Optional[List[DeliveryReceiptStatusCodeType]]) – Comma separated list of delivery_receipt_error_codes to include (optional)
client_reference (Optional[str]) – The client identifier of the batch this delivery report belongs to, if set when submitting batch. (optional)
**kwargs –
Additional parameters for the request.
- Returns:
BatchDeliveryReport
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/sms/.
- get_for_number(
- batch_id: str,
- recipient: str,
- **kwargs,
A recipient delivery report contains the message status for a single recipient phone number.
- Parameters:
batch_id (str) – The batch ID you received from sending a message. (required)
recipient (str) – Phone number for which you want to search. (required)
**kwargs –
Additional parameters for the request.
- Returns:
RecipientDeliveryReport
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/sms/.
- list(
- page: int | None = None,
- page_size: int | None = None,
- start_date: datetime | None = None,
- end_date: datetime | None = None,
- status: List[Literal['QUEUED', 'DISPATCHED', 'ABORTED', 'CANCELLED', 'FAILED', 'DELIVERED', 'EXPIRED', 'REJECTED', 'DELETED', 'UNKNOWN'] | Annotated[str, Strict(strict=True)]] | None = None,
- code: List[Literal[400, 401, 402, 403, 404, 405, 406, 407, 408, 410, 411, 412, 413, 414, 415, 416, 417, 418] | Annotated[int, Strict(strict=True)]] | None = None,
- client_reference: str | None = None,
- **kwargs,
Get a list of finished delivery reports. This operation supports pagination.
- Parameters:
page (Optional[int]) – The page number starting from 0. (optional)
page_size (Optional[int]) – Determines the size of a page. (optional)
start_date (Optional[datetime]) – Only list messages received at or after this date/time. Default: 24h ago (optional)
end_date (Optional[datetime]) – Only list messages received before this date/time. (optional)
status (Optional[List[DeliveryStatusType]]) – Comma separated list of delivery report statuses to include. (optional)
code (Optional[List[DeliveryReceiptStatusCodeType]]) – Comma separated list of delivery receipt error codes to include. (optional)
client_reference (Optional[str]) – Client reference to include (optional)
**kwargs –
Additional parameters for the request.
- Returns:
Paginator[RecipientDeliveryReport]
- Return type:
For detailed documentation, visit https://developers.sinch.com/docs/sms/.