Package pl.gsmservice.gateway
Class Sms
- java.lang.Object
-
- pl.gsmservice.gateway.Sms
-
- All Implemented Interfaces:
SDKMethodInterfaces.MethodCallGetSmsPrice,SDKMethodInterfaces.MethodCallSendSms
public class Sms extends java.lang.Object implements SDKMethodInterfaces.MethodCallGetSmsPrice, SDKMethodInterfaces.MethodCallSendSms
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetSmsPriceRequestBuildergetPrice()Check the price of SMS Messages Check the price of single or multiple SMS messages at the same time before sending them.GetSmsPriceResponsegetPrice(GetSmsPriceRequestBody request)Check the price of SMS Messages Check the price of single or multiple SMS messages at the same time before sending them.GetSmsPriceResponsegetPrice(GetSmsPriceRequestBody request, java.util.Optional<Options> options)Check the price of SMS Messages Check the price of single or multiple SMS messages at the same time before sending them.SendSmsRequestBuildersend()Send SMS Messages Send single or multiple SMS messages at the same time.SendSmsResponsesend(SendSmsRequestBody request)Send SMS Messages Send single or multiple SMS messages at the same time.SendSmsResponsesend(SendSmsRequestBody request, java.util.Optional<Options> options)Send SMS Messages Send single or multiple SMS messages at the same time.
-
-
-
Method Detail
-
getPrice
public GetSmsPriceRequestBuilder getPrice()
Check the price of SMS Messages Check the price of single or multiple SMS messages at the same time before sending them. You have to pass as request body the `Sms` object (for single message) or `array` of `Sms` objects (for multiple messages). Each object has several properties, describing message parameters such recipient phone number, content of the message, type, etc. Please mind that some of them are required. The system will accept maximum **100** messages in one call. If you need to check the price of larger volume of messages, please split it to several separate requests. As a successful result an `array` of `Price` objects will be returned, one object per each single message. You should check the `error` property of each message in a response body to make sure which were priced successfully and which finished with an error. Successfully priced messages will have `null` value of `error` property. Response will also include meta-data headers: `X-Success-Count` (a count of messages which were processed successfully) and `X-Error-Count` (count of messages which were rejected). If you send duplicated messages in one call, API will process such message only once. This request have to be authenticated using **API Access Token**. In case of an error, the `ErrorResponse` object will be returned with proper HTTP header status code (our error response complies with [RFC 9457](https://www.rfc-editor.org/rfc/rfc7807)).- Returns:
- The call builder
-
getPrice
public GetSmsPriceResponse getPrice(GetSmsPriceRequestBody request) throws java.lang.Exception
Check the price of SMS Messages Check the price of single or multiple SMS messages at the same time before sending them. You have to pass as request body the `Sms` object (for single message) or `array` of `Sms` objects (for multiple messages). Each object has several properties, describing message parameters such recipient phone number, content of the message, type, etc. Please mind that some of them are required. The system will accept maximum **100** messages in one call. If you need to check the price of larger volume of messages, please split it to several separate requests. As a successful result an `array` of `Price` objects will be returned, one object per each single message. You should check the `error` property of each message in a response body to make sure which were priced successfully and which finished with an error. Successfully priced messages will have `null` value of `error` property. Response will also include meta-data headers: `X-Success-Count` (a count of messages which were processed successfully) and `X-Error-Count` (count of messages which were rejected). If you send duplicated messages in one call, API will process such message only once. This request have to be authenticated using **API Access Token**. In case of an error, the `ErrorResponse` object will be returned with proper HTTP header status code (our error response complies with [RFC 9457](https://www.rfc-editor.org/rfc/rfc7807)).- Parameters:
request- The request object containing all of the parameters for the API call.- Returns:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
getPrice
public GetSmsPriceResponse getPrice(GetSmsPriceRequestBody request, java.util.Optional<Options> options) throws java.lang.Exception
Check the price of SMS Messages Check the price of single or multiple SMS messages at the same time before sending them. You have to pass as request body the `Sms` object (for single message) or `array` of `Sms` objects (for multiple messages). Each object has several properties, describing message parameters such recipient phone number, content of the message, type, etc. Please mind that some of them are required. The system will accept maximum **100** messages in one call. If you need to check the price of larger volume of messages, please split it to several separate requests. As a successful result an `array` of `Price` objects will be returned, one object per each single message. You should check the `error` property of each message in a response body to make sure which were priced successfully and which finished with an error. Successfully priced messages will have `null` value of `error` property. Response will also include meta-data headers: `X-Success-Count` (a count of messages which were processed successfully) and `X-Error-Count` (count of messages which were rejected). If you send duplicated messages in one call, API will process such message only once. This request have to be authenticated using **API Access Token**. In case of an error, the `ErrorResponse` object will be returned with proper HTTP header status code (our error response complies with [RFC 9457](https://www.rfc-editor.org/rfc/rfc7807)).- Specified by:
getPricein interfaceSDKMethodInterfaces.MethodCallGetSmsPrice- Parameters:
request- The request object containing all of 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 SendSmsRequestBuilder send()
Send SMS Messages Send single or multiple SMS messages at the same time. You have to pass as request body the `Sms` object (for single message) or `array` of `Sms` objects (for multiple messages). Each object has several properties, describing message parameters such recipient phone number, content of the message, type or scheduled sending date, etc. Please mind that some of them are required. The system will accept maximum 100 messages in one call. If you need to send larger volume of messages, please split it to several separate requests. As a successful result an `array` with `Message` objects will be returned, one object per each single message. You should check the `status_code` property of each message in a response body to make sure which were accepted by gateway (queued) and which were rejected. In case of rejection, `status_description` property will include a reason. Response will also include meta-data headers: `X-Success-Count` (a count of messages which were processed successfully), `X-Error-Count` (count of messages which were rejected) and `X-Sandbox` (if a request was made in Sandbox or Production system). If you send duplicated messages in one call, API will process such message only once. This request have to be authenticated using **API Access Token**. In case of an error, the `ErrorResponse` object will be returned with proper HTTP header status code (our error response complies with [RFC 9457](https://www.rfc-editor.org/rfc/rfc7807)).- Returns:
- The call builder
-
send
public SendSmsResponse send(SendSmsRequestBody request) throws java.lang.Exception
Send SMS Messages Send single or multiple SMS messages at the same time. You have to pass as request body the `Sms` object (for single message) or `array` of `Sms` objects (for multiple messages). Each object has several properties, describing message parameters such recipient phone number, content of the message, type or scheduled sending date, etc. Please mind that some of them are required. The system will accept maximum 100 messages in one call. If you need to send larger volume of messages, please split it to several separate requests. As a successful result an `array` with `Message` objects will be returned, one object per each single message. You should check the `status_code` property of each message in a response body to make sure which were accepted by gateway (queued) and which were rejected. In case of rejection, `status_description` property will include a reason. Response will also include meta-data headers: `X-Success-Count` (a count of messages which were processed successfully), `X-Error-Count` (count of messages which were rejected) and `X-Sandbox` (if a request was made in Sandbox or Production system). If you send duplicated messages in one call, API will process such message only once. This request have to be authenticated using **API Access Token**. In case of an error, the `ErrorResponse` object will be returned with proper HTTP header status code (our error response complies with [RFC 9457](https://www.rfc-editor.org/rfc/rfc7807)).- Parameters:
request- The request object containing all of the parameters for the API call.- Returns:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
send
public SendSmsResponse send(SendSmsRequestBody request, java.util.Optional<Options> options) throws java.lang.Exception
Send SMS Messages Send single or multiple SMS messages at the same time. You have to pass as request body the `Sms` object (for single message) or `array` of `Sms` objects (for multiple messages). Each object has several properties, describing message parameters such recipient phone number, content of the message, type or scheduled sending date, etc. Please mind that some of them are required. The system will accept maximum 100 messages in one call. If you need to send larger volume of messages, please split it to several separate requests. As a successful result an `array` with `Message` objects will be returned, one object per each single message. You should check the `status_code` property of each message in a response body to make sure which were accepted by gateway (queued) and which were rejected. In case of rejection, `status_description` property will include a reason. Response will also include meta-data headers: `X-Success-Count` (a count of messages which were processed successfully), `X-Error-Count` (count of messages which were rejected) and `X-Sandbox` (if a request was made in Sandbox or Production system). If you send duplicated messages in one call, API will process such message only once. This request have to be authenticated using **API Access Token**. In case of an error, the `ErrorResponse` object will be returned with proper HTTP header status code (our error response complies with [RFC 9457](https://www.rfc-editor.org/rfc/rfc7807)).- Specified by:
sendin interfaceSDKMethodInterfaces.MethodCallSendSms- Parameters:
request- The request object containing all of 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
-
-