sinch.domains.sms.api.v1.batches_apis module

class sinch.domains.sms.api.v1.batches_apis.Batches(sinch)[source]

Bases: BaseSms

cancel(
batch_id: str,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

A batch can be canceled at any point. If a batch is canceled while it’s currently being delivered some messages currently being processed might still be delivered. The delivery report will indicate which messages were canceled and which weren’t.

Canceling a batch scheduled in the future will result in an empty delivery report while canceling an already sent batch would result in no change to the completed delivery report.

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • **kwargs

    Additional parameters for the request.

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

dry_run(
request: DryRunTextRequest | DryRunBinaryRequest | DryRunMediaRequest | None = None,
per_recipient: bool | None = None,
number_of_recipients: int | None = None,
**kwargs,
) DryRunResponse[source]

This operation will perform a dry run of a batch which calculates the bodies and number of parts for all messages in the batch without actually sending any messages.

Parameters:
  • request (Optional[DryRunRequest]) – The request object. (optional)

  • per_recipient (Optional[bool]) – Whether to include per recipient details in the response (optional)

  • number_of_recipients (Optional[int]) – Max number of recipients to include per recipient details for in the response (optional)

  • **kwargs

    Additional parameters for the request.

Returns:

DryRunResponse

Return type:

DryRunResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

dry_run_sms(
to: List[str],
from_: str,
body: str,
per_recipient: bool | None = None,
number_of_recipients: int | None = None,
parameters: Dict[str, Dict[str, str]] | None = None,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
flash_message: bool | None = None,
max_number_of_message_parts: int | None = None,
truncate_concat: bool | None = None,
from_ton: int | None = None,
from_npi: int | None = None,
**kwargs,
) DryRunResponse[source]

This operation will perform a dry run of a batch which calculates the bodies and number of parts for all messages in the batch without actually sending any messages (SMS).

Parameters:
  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (str) – The message body. (required)

  • per_recipient (Optional[bool]) – Whether to include per recipient details in the response (optional)

  • number_of_recipients (Optional[int]) – Max number of recipients to include per recipient details for in the response (optional)

  • parameters (Optional[Dict[str, Dict[str, str]]]) – The parameters for the message. (optional)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • flash_message (Optional[bool]) – Whether to enable flash message. (optional)

  • max_number_of_message_parts (Optional[int]) – The maximum number of message parts. (optional)

  • truncate_concat (Optional[bool]) – Whether to truncate the message if it is too long. (optional)

  • from_ton (Optional[int]) – The type of number for the sender number. (optional)

  • from_npi (Optional[int]) – The number plan indicator for the sender number. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

DryRunResponse

Return type:

DryRunResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

dry_run_binary(
to: List[str],
from_: str,
body: str,
udh: str,
per_recipient: bool | None = None,
number_of_recipients: int | None = None,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
from_ton: int | None = None,
from_npi: int | None = None,
**kwargs,
) DryRunResponse[source]

This operation will perform a dry run of a batch which calculates the bodies and number of parts for all messages in the batch without actually sending any messages (Binary).

Parameters:
  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (str) – The message body. (required)

  • udh (str) – The user data header. (required)

  • per_recipient (Optional[bool]) – Whether to include per recipient details in the response (optional)

  • number_of_recipients (Optional[int]) – Max number of recipients to include per recipient details for in the response (optional)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • from_ton (Optional[int]) – The type of number for the sender number. (optional)

  • from_npi (Optional[int]) – The number plan indicator for the sender number. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

DryRunResponse

Return type:

DryRunResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

dry_run_mms(
to: List[str],
from_: str,
body: MediaBodyDict,
per_recipient: bool | None = None,
number_of_recipients: int | None = None,
parameters: Dict[str, Dict[str, str]] | None = None,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
strict_validation: bool | None = None,
**kwargs,
) DryRunResponse[source]

This operation will perform a dry run of a batch which calculates the bodies and number of parts for all messages in the batch without actually sending any messages (MMS).

Parameters:
  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (MediaBodyDict) – The message body. (required)

  • per_recipient (Optional[bool]) – Whether to include per recipient details in the response (optional)

  • number_of_recipients (Optional[int]) – Max number of recipients to include per recipient details for in the response (optional)

  • parameters (Optional[Dict[str, Dict[str, str]]]) – The parameters for the message. (optional)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • strict_validation (Optional[bool]) – Whether to enable strict validation. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

DryRunResponse

Return type:

DryRunResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

get(
batch_id: str,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation returns a specific batch that matches the provided batch ID.

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • **kwargs

    Additional parameters for the request.

Returns:

BatchResponse

Return type:

BatchResponse

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,
from_: List[str] | None = None,
client_reference: str | None = None,
**kwargs,
) Paginator[Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')]][source]

With the list operation you can list batch messages created in the last 14 days that you have created. 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. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): YYYY-MM-DDThh:mm:ss.SSSZ. Default: Now-24 (optional)

  • end_date (Optional[datetime]) – Only list messages received before this date/time. Formatted as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601): YYYY-MM-DDThh:mm:ss.SSSZ. (optional)

  • from (Optional[List[str]]) – Only list messages sent from this sender number. Multiple originating numbers can be comma separated. Must be phone numbers or short code. (optional)

  • client_reference (Optional[str]) – Client reference to include (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (List[str] | None)

Returns:

Paginator[BatchResponse]

Return type:

Paginator[BatchResponse]

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

replace(
batch_id: str,
request: ReplaceTextRequest | ReplaceBinaryRequest | ReplaceMediaRequest | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation will replace all the parameters of a batch with the provided values. It is the same as cancelling a batch and sending a new one instead.

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • request (Optional[ReplaceBatchRequest]) – The request object. (optional)

  • **kwargs

    Additional parameters for the request.

Returns:

BatchResponse

Return type:

BatchResponse

For additional documentation, see https://www.sinch.com and visit our developer portal.

replace_sms(
batch_id: str,
to: List[str],
from_: str,
body: str,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
flash_message: bool | None = None,
max_number_of_message_parts: int | None = None,
truncate_concat: bool | None = None,
from_ton: int | None = None,
from_npi: int | None = None,
parameters: Dict[str, Dict[str, str]] | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation will replace all the parameters of a batch with the provided values. It is the same as cancelling a batch and sending a new one instead (MMS).

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (str) – The message body. (required)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • flash_message (Optional[bool]) – Whether to enable flash message. (optional)

  • max_number_of_message_parts (Optional[int]) – The maximum number of message parts. (optional)

  • truncate_concat (Optional[bool]) – Whether to truncate the message if it is too long. (optional)

  • from_ton (Optional[int]) – The type of number for the sender number. (optional)

  • from_npi (Optional[int]) – The number plan indicator for the sender number. (optional)

  • parameters (Optional[Dict[str, Dict[str, str]]]) – The parameters for the message. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

BatchResponse

Return type:

BatchResponse

For additional documentation, see https://www.sinch.com and visit our developer portal.

replace_binary(
batch_id: str,
to: List[str],
from_: str,
body: str,
udh: str,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
from_ton: int | None = None,
from_npi: int | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation will replace all the parameters of a batch with the provided values. It is the same as cancelling a batch and sending a new one instead (Binary).

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (str) – The message body. (required)

  • udh (str) – The user data header. (required)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • from_ton (Optional[int]) – The type of number for the sender number. (optional)

  • from_npi (Optional[int]) – The number plan indicator for the sender number. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

BatchResponse

Return type:

BatchResponse

For additional documentation, see https://www.sinch.com and visit our developer portal.

replace_mms(
batch_id: str,
to: List[str],
from_: str,
body: MediaBodyDict,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
strict_validation: bool | None = None,
parameters: Dict[str, Dict[str, str]] | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation will replace all the parameters of a batch with the provided values. It is the same as cancelling a batch and sending a new one instead (MMS).

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (MediaBodyDict) – The message body. (required)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • strict_validation (Optional[bool]) – Whether to enable strict validation. (optional)

  • parameters (Optional[Dict[str, Dict[str, str]]]) – The parameters for the message. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

BatchResponse

Return type:

BatchResponse

For additional documentation, see https://www.sinch.com and visit our developer portal.

send(
request: TextRequest | BinaryRequest | MediaRequest | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

Send a message or a batch of messages.

Depending on the length of the body, one message might be split into multiple parts and charged accordingly.

Any groups targeted in a scheduled batch will be evaluated at the time of sending. If a group is deleted between batch creation and scheduled date, it will be considered empty.

Be sure to use the correct [region](/docs/sms/api-reference/#base-url) in the server URL.

Parameters:
  • request (Optional[SendSMSRequest]) – The request object. (optional)

  • **kwargs

    Additional parameters for the request.

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

send_sms(
to: List[str],
from_: str,
body: str,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
flash_message: bool | None = None,
max_number_of_message_parts: int | None = None,
truncate_concat: bool | None = None,
from_ton: int | None = None,
from_npi: int | None = None,
parameters: Dict[str, Dict[str, str]] | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

Send a message or a batch of messages (SMS).

Depending on the length of the body, one message might be split into multiple parts and charged accordingly.

Any groups targeted in a scheduled batch will be evaluated at the time of sending. If a group is deleted between batch creation and scheduled date, it will be considered empty.

Be sure to use the correct [region](/docs/sms/api-reference/#base-url) in the server URL.

Parameters:
  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (str) – The message body. (required)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • flash_message (Optional[bool]) – Whether to enable flash message. (optional)

  • max_number_of_message_parts (Optional[int]) – The maximum number of message parts. (optional)

  • truncate_concat (Optional[bool]) – Whether to truncate the message if it is too long. (optional)

  • from_ton (Optional[int]) – The type of number for the sender number. (optional)

  • from_npi (Optional[int]) – The number plan indicator for the sender number. (optional)

  • parameters (Optional[Dict[str, Dict[str, str]]]) – The parameters for the message. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

send_binary(
to: List[str],
from_: str,
body: str,
udh: str,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
from_ton: int | None = None,
from_npi: int | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

Send a message or a batch of messages (Binary).

Depending on the length of the body, one message might be split into multiple parts and charged accordingly.

Any groups targeted in a scheduled batch will be evaluated at the time of sending. If a group is deleted between batch creation and scheduled date, it will be considered empty.

Be sure to use the correct [region](/docs/sms/api-reference/#base-url) in the server URL.

Parameters:
  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (str) – The message body. (required)

  • udh (str) – The user data header. (required)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • from_ton (Optional[int]) – The type of number for the sender number. (optional)

  • from_npi (Optional[int]) – The number plan indicator for the sender number. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

send_mms(
to: List[str],
from_: str,
body: MediaBodyDict,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
strict_validation: bool | None = None,
parameters: Dict[str, Dict[str, str]] | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

Send a message or a batch of messages (MMS).

Depending on the length of the body, one message might be split into multiple parts and charged accordingly.

Any groups targeted in a scheduled batch will be evaluated at the time of sending. If a group is deleted between batch creation and scheduled date, it will be considered empty.

Be sure to use the correct [region](/docs/sms/api-reference/#base-url) in the server URL.

Parameters:
  • to (List[str]) – The list of phone numbers to send the message to. (required)

  • from (str) – The sender phone number. (required)

  • body (MediaBodyDict) – The message body. (required)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • strict_validation (Optional[bool]) – Whether to enable strict validation. (optional)

  • parameters (Optional[Dict[str, Dict[str, str]]]) – The parameters for the message. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str)

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

send_delivery_feedback(
batch_id: str,
recipients: List[str],
**kwargs,
) None[source]

Send feedback if your system can confirm successful message delivery.

Feedback can only be provided if feedback_enabled was set when batch was submitted.

Batches: It is possible to submit feedback multiple times for the same batch for different recipients. Feedback without specified recipients is treated as successful message delivery to all recipients referenced in the batch. Note that the recipients key is still required even if the value is empty.

Groups: If the batch message was creating using a group ID, at least one recipient is required. Excluding recipients (an empty recipient list) does not work and will result in a failed request.

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • recipients (List[str]) – A list of phone numbers (MSISDNs) that have successfully received the message. The key is required, however, the value can be an empty array ([]) for a batch. If the feedback was enabled for a group, at least one phone number is required. (required)

  • **kwargs

    Additional parameters for the request.

Returns:

None

Return type:

None

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

update(
batch_id: str,
request: UpdateTextRequestWithBatchId | UpdateBinaryRequestWithBatchId | UpdateMediaRequestWithBatchId | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation updates all specified parameters of a batch that matches the provided batch ID.

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • request (Optional[UpdateBatchMessageRequest]) – The request object. (optional)

  • **kwargs

    Additional parameters for the request.

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

update_sms(
batch_id: str,
from_: str | None = None,
to_add: List[str] | None = None,
to_remove: List[str] | None = None,
body: str | None = None,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
parameters: Dict[str, Dict[str, str]] | None = None,
from_ton: int | None = None,
from_npi: int | None = None,
max_number_of_message_parts: int | None = None,
truncate_concat: bool | None = None,
flash_message: bool | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation updates all specified parameters of a batch that matches the provided batch ID. (SMS)

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • from (Optional[str]) – The sender phone number. (optional)

  • to_add (Optional[List[str]]) – The list of phone numbers to add to the batch. (optional)

  • to_remove (Optional[List[str]]) – The list of phone numbers to remove from the batch. (optional)

  • body (Optional[str]) – The message body. (optional)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • parameters (Optional[Dict[str, Dict[str, str]]]) – The parameters for the message. (optional)

  • from_ton (Optional[int]) – The type of number for the sender number. (optional)

  • from_npi (Optional[int]) – The number plan indicator for the sender number. (optional)

  • max_number_of_message_parts (Optional[int]) – The maximum number of message parts. (optional)

  • truncate_concat (Optional[bool]) – Whether to truncate the message if it is too long. (optional)

  • flash_message (Optional[bool]) – Whether to enable flash message. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str | None)

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

update_binary(
batch_id: str,
udh: str,
from_: str | None = None,
to_add: List[str] | None = None,
to_remove: List[str] | None = None,
body: str | None = None,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
from_ton: int | None = None,
from_npi: int | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation updates all specified parameters of a batch that matches the provided batch ID. (Binary)

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • udh (str) – The user data header. (required)

  • from (Optional[str]) – The sender phone number. (optional)

  • to_add (Optional[List[str]]) – The list of phone numbers to add to the batch. (optional)

  • to_remove (Optional[List[str]]) – The list of phone numbers to remove from the batch. (optional)

  • body (Optional[str]) – The message body. (optional)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • from_ton (Optional[int]) – The type of number for the sender number. (optional)

  • from_npi (Optional[int]) – The number plan indicator for the sender number. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str | None)

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.

update_mms(
batch_id: str,
from_: str | None = None,
to_add: List[str] | None = None,
to_remove: List[str] | None = None,
body: MediaBodyDict | None = None,
delivery_report: Literal['none', 'summary', 'full', 'per_recipient', 'per_recipient_final'] | Annotated[str, Strict(strict=True)] | None = None,
send_at: datetime | None = None,
expire_at: datetime | None = None,
event_destination_target: str | None = None,
client_reference: str | None = None,
feedback_enabled: bool | None = None,
parameters: Dict[str, Dict[str, str]] | None = None,
strict_validation: bool | None = None,
**kwargs,
) Annotated[TextResponse | BinaryResponse | MediaResponse, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]

This operation updates all specified parameters of a batch that matches the provided batch ID. (MMS)

Parameters:
  • batch_id (str) – The batch ID you received from sending a message. (required)

  • from (Optional[str]) – The sender phone number. (optional)

  • to_add (Optional[List[str]]) – The list of phone numbers to add to the batch. (optional)

  • to_remove (Optional[List[str]]) – The list of phone numbers to remove from the batch. (optional)

  • body (Optional[MediaBodyDict]) – The message body. (optional)

  • delivery_report (Optional[DeliveryReportType]) – The delivery report type. (optional)

  • send_at (Optional[datetime]) – The time to send the message at. (optional)

  • expire_at (Optional[datetime]) – The time to expire the message at. (optional)

  • event_destination_target (Optional[str]) – The callback URL to receive the delivery report. (optional)

  • client_reference (Optional[str]) – The client reference to identify the message. (optional)

  • feedback_enabled (Optional[bool]) – Whether to enable feedback. (optional)

  • parameters (Optional[Dict[str, Dict[str, str]]]) – The parameters for the message. (optional)

  • strict_validation (Optional[bool]) – Whether to enable strict validation. (optional)

  • **kwargs

    Additional parameters for the request.

  • from_ (str | None)

Returns:

BatchResponse

Return type:

BatchResponse

For detailed documentation, visit https://developers.sinch.com/docs/sms/.