Package com.sinch.sdk.domains.sms
Interface BatchesService
-
public interface BatchesServiceBatches Service- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Batch<?>>
Tcancel(String batchId)Cancel a batch message
A batch can be canceled at any point.DryRundryRun(boolean perRecipient, int numberOfRecipient, BaseBatch<?> batch)Dry run
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.<T extends Batch<?>>
Tget(String batchId)Get a batch message
This operation returns a specific batch that matches the provided batch ID.BatchesListResponselist(BatchesListRequestParameters parameters)List Batches
With the list operation you can list batch messages created in the last 14 days that you have created.<T extends Batch<?>>
Treplace(String batchId, BaseBatch<?> batch)Replace a batch
This operation will replace all the parameters of a batch with the provided values.<T extends Batch<?>>
Tsend(BaseBatch<?> batch)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.voidsendDeliveryFeedback(String batchId, Collection<String> recipients)Send delivery feedback for a message<T extends Batch<?>>
Tupdate(String batchId, UpdateBaseBatchRequest<?> batch)Update a Batch message
This operation updates all specified parameters of a batch that matches the provided batch ID.
-
-
-
Method Detail
-
get
<T extends Batch<?>> T get(String batchId) throws ApiException
Get a batch message
This operation returns a specific batch that matches the provided batch ID.- Type Parameters:
T- A type of Batch- Parameters:
batchId- The batch ID you received from sending a message- Returns:
- Batch information
- Throws:
ApiException- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/GetBatchMessage
-
send
<T extends Batch<?>> T send(BaseBatch<?> batch) throws ApiException
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 in the server URL.- Type Parameters:
T- A type of Batch- Parameters:
batch- The batch to be created- Returns:
- Batch information
- Throws:
ApiException- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/SendSMS
-
dryRun
DryRun dryRun(boolean perRecipient, int numberOfRecipient, BaseBatch<?> batch) throws ApiException
Dry run
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:
perRecipient- Whether to include per recipient details in the responsenumberOfRecipient- Max number of recipients to include per recipient details for in the responsebatch- The batch to be send- Returns:
- Details about dryRun execution
- Throws:
ApiException- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/Dry_Run
-
list
BatchesListResponse list(BatchesListRequestParameters parameters) throws ApiException
List Batches
With the list operation you can list batch messages created in the last 14 days that you have created. This operation supports pagination.- Parameters:
parameters- Query parameters filtering returned batches- Returns:
- Paginated list of Batches
- Throws:
ApiException- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/ListBatches
-
update
<T extends Batch<?>> T update(String batchId, UpdateBaseBatchRequest<?> batch) throws ApiException
Update a Batch message
This operation updates all specified parameters of a batch that matches the provided batch ID.- Type Parameters:
T- A type of Batch- Parameters:
batchId- The batch ID you received from sending a messagebatch- Batch parameters to be updated- Returns:
- Batch information
- Throws:
ApiException- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/UpdateBatchMessage
-
replace
<T extends Batch<?>> T replace(String batchId, BaseBatch<?> batch) throws ApiException
Replace a batch
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.- Type Parameters:
T- A type of Batch- Parameters:
batchId- The batch ID you received from sending a messagebatch- Batch parameters to be used- Returns:
- Batch information
- Throws:
ApiException- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/ReplaceBatch
-
cancel
<T extends Batch<?>> T cancel(String batchId) throws ApiException
Cancel a batch message
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.- Type Parameters:
T- A type of Batch- Parameters:
batchId- The batch ID you received from sending a message- Returns:
- Batch information
- Throws:
ApiException- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/CancelBatchMessage
-
sendDeliveryFeedback
void sendDeliveryFeedback(String batchId, Collection<String> recipients) throws ApiException
Send delivery feedback for a messageSend 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:
batchId- The batch ID you received from sending a messagerecipients- 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.- Throws:
ApiException- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/sms/api-reference/sms/tag/Batches/#tag/Batches/operation/deliveryFeedback
-
-