Class AsyncMms
- java.lang.Object
-
- pl.gsmservice.gateway.AsyncMms
-
public class AsyncMms extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetMmsPriceRequestBuildergetPrice()Check the price of MMS Messagesjava.util.concurrent.CompletableFuture<GetMmsPriceResponse>getPrice(GetMmsPriceRequestBody request)Check the price of MMS Messagesjava.util.concurrent.CompletableFuture<GetMmsPriceResponse>getPrice(GetMmsPriceRequestBody request, java.util.Optional<Options> options)Check the price of MMS MessagesSendMmsRequestBuildersend()Send MMS Messagesjava.util.concurrent.CompletableFuture<SendMmsResponse>send(SendMmsRequestBody request)Send MMS Messagesjava.util.concurrent.CompletableFuture<SendMmsResponse>send(SendMmsRequestBody request, java.util.Optional<Options> options)Send MMS MessagesMmssync()Switches to the sync SDK.
-
-
-
Method Detail
-
sync
public Mms sync()
Switches to the sync SDK.- Returns:
- The sync SDK
-
getPrice
public GetMmsPriceRequestBuilder getPrice()
Check the price of MMS Messages
Check the price of single or multiple MMS messages at the same time before sending them. You can pass a singleMmsMessageobject usingGetMmsPriceRequestBody.of(MmsMessage)method (for single message) orList<SmsMessage>usingGetMmsPriceRequestBody.of(List.of(MmsMessage,...))method (for multiple messages).
EachMmsMessageobject has several properties, describing message parameters such recipient phone number, content of the message, attachments, etc. Please use builder style:
GetMmsPriceResponse res = sdk.outgoing().mms().getPrice() .request(req) // here pass GetMmsPriceRequestBody.of(...) object .call();
The method will accept maximum 50 messages in one call.
As a successful result aGetMmsPriceResponseobject will be returned withpricesproperty of typeList<Price>containing aPriceobjects, one object per each single message. You should check theerrorproperty of eachPriceobject to make sure which messages were priced successfully and which finished with an error. Successfully priced messages will havenullvalue oferrorproperty.
GetMmsPriceResponseobject will include alsoheadersproperty withX-Success-Count(a count of messages which were processed successfully) andX-Error-Count(count of messages which were rejected) elements.- Returns:
- The async call builder
-
getPrice
public java.util.concurrent.CompletableFuture<GetMmsPriceResponse> getPrice(GetMmsPriceRequestBody request)
Check the price of MMS Messages
Check the price of single or multiple MMS messages at the same time before sending them. You can pass a singleMmsMessageobject usingGetMmsPriceRequestBody.of(MmsMessage)method (for single message) orList<SmsMessage>usingGetMmsPriceRequestBody.of(List.of(MmsMessage,...))method (for multiple messages).
EachMmsMessageobject has several properties, describing message parameters such recipient phone number, content of the message, attachments, etc. Please use builder style:
GetMmsPriceResponse res = sdk.outgoing().mms().getPrice() .request(req) // here pass GetMmsPriceRequestBody.of(...) object .call();
The method will accept maximum 50 messages in one call.
As a successful result aGetMmsPriceResponseobject will be returned withpricesproperty of typeList<Price>containing aPriceobjects, one object per each single message. You should check theerrorproperty of eachPriceobject to make sure which messages were priced successfully and which finished with an error. Successfully priced messages will havenullvalue oferrorproperty.
GetMmsPriceResponseobject will include alsoheadersproperty withX-Success-Count(a count of messages which were processed successfully) andX-Error-Count(count of messages which were rejected) elements.- Parameters:
request- The request object containing all the parameters for the API call.- Returns:
- CompletableFuture<GetMmsPriceResponse> - The async response
-
getPrice
public java.util.concurrent.CompletableFuture<GetMmsPriceResponse> getPrice(GetMmsPriceRequestBody request, java.util.Optional<Options> options)
Check the price of MMS Messages
Check the price of single or multiple MMS messages at the same time before sending them. You can pass a singleMmsMessageobject usingGetMmsPriceRequestBody.of(MmsMessage)method (for single message) orList<SmsMessage>usingGetMmsPriceRequestBody.of(List.of(MmsMessage,...))method (for multiple messages).
EachMmsMessageobject has several properties, describing message parameters such recipient phone number, content of the message, attachments, etc. Please use builder style:
GetMmsPriceResponse res = sdk.outgoing().mms().getPrice() .request(req) // here pass GetMmsPriceRequestBody.of(...) object .call();
The method will accept maximum 50 messages in one call.
As a successful result aGetMmsPriceResponseobject will be returned withpricesproperty of typeList<Price>containing aPriceobjects, one object per each single message. You should check theerrorproperty of eachPriceobject to make sure which messages were priced successfully and which finished with an error. Successfully priced messages will havenullvalue oferrorproperty.
GetMmsPriceResponseobject will include alsoheadersproperty withX-Success-Count(a count of messages which were processed successfully) andX-Error-Count(count of messages which were rejected) elements.- Parameters:
request- The request object containing all the parameters for the API call.options- additional options- Returns:
- CompletableFuture<GetMmsPriceResponse> - The async response
-
send
public SendMmsRequestBuilder send()
Send MMS Messages
Send single or multiple MMS messages at the same time. You can pass a singleMmsMessageobject usingSendMmsRequestBody.of(MmsMessage)method (for single message) orList<MmsMessage>usingSendMmsRequestBody.of(List.of(MmsMessage,...))method (for multiple messages). EachMmsMessageobject has several properties, describing message parameters such recipient phone number, content of the message, attachments or scheduled sending date, etc. Please use builder style:
SendMmsResponse res = sdk.outgoing().mms().send() .request(req) // here pass GetMmsPriceRequestBody.of(...) object .call();
This method will accept maximum 50 messages in one call.
As a successful result aSendMmsResponseobject will be returned withmessagesproperty of type List<Message> containingMessageobjects, one object per each single message. You should check thestatusCodeproperty of eachMessageobject to make sure which messages were accepted by gateway (queued) and which were rejected. In case of rejection,statusDescriptionproperty will include a reason.
SendMmsResponsewill also includeheadersproperty withX-Success-Count(a count of messages which were processed successfully),X-Error-Count(count of messages which were rejected) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Returns:
- The async call builder
-
send
public java.util.concurrent.CompletableFuture<SendMmsResponse> send(SendMmsRequestBody request)
Send MMS Messages
Send single or multiple MMS messages at the same time. You can pass a singleMmsMessageobject usingSendMmsRequestBody.of(MmsMessage)method (for single message) orList<MmsMessage>usingSendMmsRequestBody.of(List.of(MmsMessage,...))method (for multiple messages). EachMmsMessageobject has several properties, describing message parameters such recipient phone number, content of the message, attachments or scheduled sending date, etc. Please use builder style:
SendMmsResponse res = sdk.outgoing().mms().send() .request(req) // here pass GetMmsPriceRequestBody.of(...) object .call();
This method will accept maximum 50 messages in one call.
As a successful result aSendMmsResponseobject will be returned withmessagesproperty of type List<Message> containingMessageobjects, one object per each single message. You should check thestatusCodeproperty of eachMessageobject to make sure which messages were accepted by gateway (queued) and which were rejected. In case of rejection,statusDescriptionproperty will include a reason.
SendMmsResponsewill also includeheadersproperty withX-Success-Count(a count of messages which were processed successfully),X-Error-Count(count of messages which were rejected) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Parameters:
request- The request object containing all the parameters for the API call.- Returns:
- CompletableFuture<SendMmsResponse> - The async response
-
send
public java.util.concurrent.CompletableFuture<SendMmsResponse> send(SendMmsRequestBody request, java.util.Optional<Options> options)
Send MMS Messages
Send single or multiple MMS messages at the same time. You can pass a singleMmsMessageobject usingSendMmsRequestBody.of(MmsMessage)method (for single message) orList<MmsMessage>usingSendMmsRequestBody.of(List.of(MmsMessage,...))method (for multiple messages). EachMmsMessageobject has several properties, describing message parameters such recipient phone number, content of the message, attachments or scheduled sending date, etc. Please use builder style:
SendMmsResponse res = sdk.outgoing().mms().send() .request(req) // here pass GetMmsPriceRequestBody.of(...) object .call();
This method will accept maximum 50 messages in one call.
As a successful result aSendMmsResponseobject will be returned withmessagesproperty of type List<Message> containingMessageobjects, one object per each single message. You should check thestatusCodeproperty of eachMessageobject to make sure which messages were accepted by gateway (queued) and which were rejected. In case of rejection,statusDescriptionproperty will include a reason.
SendMmsResponsewill also includeheadersproperty withX-Success-Count(a count of messages which were processed successfully),X-Error-Count(count of messages which were rejected) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Parameters:
request- The request object containing all the parameters for the API call.options- additional options- Returns:
- CompletableFuture<SendMmsResponse> - The async response
-
-