Class Mms
- java.lang.Object
-
- pl.gsmservice.gateway.Mms
-
public class Mms extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncMmsasync()Switches to the async SDK.GetMmsPriceRequestBuildergetPrice()Check the price of MMS MessagesGetMmsPriceResponsegetPrice(GetMmsPriceRequestBody request)Check the price of MMS MessagesGetMmsPriceResponsegetPrice(GetMmsPriceRequestBody request, java.util.Optional<Options> options)Check the price of MMS MessagesSendMmsRequestBuildersend()Send MMS MessagesSendMmsResponsesend(SendMmsRequestBody request)Send MMS MessagesSendMmsResponsesend(SendMmsRequestBody request, java.util.Optional<Options> options)Send MMS Messages
-
-
-
Method Detail
-
async
public AsyncMms async()
Switches to the async SDK.- Returns:
- The async 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 call builder
-
getPrice
public GetMmsPriceResponse getPrice(GetMmsPriceRequestBody request) throws java.lang.Exception
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:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
getPrice
public GetMmsPriceResponse getPrice(GetMmsPriceRequestBody request, java.util.Optional<Options> options) throws java.lang.Exception
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:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
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 call builder
-
send
public SendMmsResponse send(SendMmsRequestBody request) throws java.lang.Exception
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:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
send
public SendMmsResponse send(SendMmsRequestBody request, java.util.Optional<Options> options) throws java.lang.Exception
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:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
-