Interface BatchesService
-
Method Summary
Modifier and TypeMethodDescriptionCancel a batch messagedryRun(BatchRequest sendRequest) Dry run (using default parameters)dryRun(DryRunQueryParameters queryParameter, BatchRequest sendRequest) Dry runGet a batch messagelist()List Batches (using default parameters)list(ListBatchesQueryParameters queryParameter) List Batchesreplace(String batchId, BatchRequest sendRequest) Replace a batchsend(BatchRequest sendRequest) SendvoidsendDeliveryFeedback(String batchId, SendDeliveryFeedbackRequest sendDeliveryFeedbackRequest) Send delivery feedback for a messageupdate(String batchId, UpdateBatchRequest updateBatchRequest) Update a Batch message
-
Method Details
-
list
List Batches (using default parameters)With the list operation you can list batch messages created in the last 14 days that you have created. This operation supports pagination.
- Returns:
- ListBatchesResponse
- Throws:
ApiException- if fails to make API call
-
list
List BatchesWith the list operation you can list batch messages created in the last 14 days that you have created. This operation supports pagination.
- Parameters:
queryParameter- (optional)- Returns:
- ListBatchesResponse
- Throws:
ApiException- if fails to make API call
-
cancel
Cancel a batch messageA 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:
batchId- The batch ID you received from sending a message. (required)- Returns:
- BatchResponse
- Throws:
ApiException- if fails to make API call
-
dryRun
Dry run (using default parameters)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:
sendRequest- (required)- Returns:
- DryRunResponse
- Throws:
ApiException- if fails to make API call
-
dryRun
DryRunResponse dryRun(DryRunQueryParameters queryParameter, BatchRequest sendRequest) throws ApiException Dry runThis 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:
queryParameter- (optional)sendRequest- (required)- Returns:
- DryRunResponse
- Throws:
ApiException- if fails to make API call
-
get
Get a batch messageThis operation returns a specific batch that matches the provided batch ID.
- Parameters:
batchId- The batch ID you received from sending a message. (required)- Returns:
- BatchResponse
- Throws:
ApiException- if fails to make API call
-
replace
Replace a batchThis 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:
batchId- The batch ID you received from sending a message. (required)sendRequest- (required)- Returns:
- BatchResponse
- Throws:
ApiException- if fails to make API call
-
send
SendSend 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](https://developers.sinch.com/docs/sms/api-reference/#base-url) in the server URL.
- Parameters:
sendRequest- (required)- Returns:
- BatchResponse
- Throws:
ApiException- if fails to make API call
-
sendDeliveryFeedback
void sendDeliveryFeedback(String batchId, SendDeliveryFeedbackRequest sendDeliveryFeedbackRequest) 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 created 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 message. (required)sendDeliveryFeedbackRequest- A list of phone numbers (MSISDNs) that successfully received the message. (required)- Throws:
ApiException- if fails to make API call
-
update
Update a Batch messageThis operation updates all specified parameters of a batch that matches the provided batch ID.
- Parameters:
batchId- The batch ID you received from sending a message. (required)updateBatchRequest- (required)- Returns:
- BatchResponse
- Throws:
ApiException- if fails to make API call
-