Class Outgoing
- java.lang.Object
-
- pl.gsmservice.gateway.Outgoing
-
public class Outgoing extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncOutgoingasync()Switches to the async SDK.CancelMessagesRequestBuildercancelScheduled()Cancel a scheduled messagesCancelMessagesResponsecancelScheduled(java.util.List<java.lang.Long> ids)Cancel a scheduled messagesCancelMessagesResponsecancelScheduled(java.util.List<java.lang.Long> ids, java.util.Optional<Options> options)Cancel a scheduled messagesGetMessagesRequestBuildergetByIds()Get the messages details and status by IDsGetMessagesResponsegetByIds(java.util.List<java.lang.Long> ids)Get the messages details and status by IDsGetMessagesResponsegetByIds(java.util.List<java.lang.Long> ids, java.util.Optional<Options> options)Get the messages details and status by IDsListMessagesRequestBuilderlist()Lists the history of sent messagesListMessagesResponselist(java.util.Optional<java.lang.Long> page, java.util.Optional<java.lang.Long> limit, java.util.Optional<Options> options)Lists the history of sent messagesListMessagesResponselistDirect()Lists the history of sent messagesMmsmms()Smssms()
-
-
-
Method Detail
-
mms
public final Mms mms()
-
sms
public final Sms sms()
-
async
public AsyncOutgoing async()
Switches to the async SDK.- Returns:
- The async SDK
-
getByIds
public GetMessagesRequestBuilder getByIds()
Get the messages details and status by IDs
Check the current status and details of one or more messages using theirids. You should pass theListOf()containing unique message IDs (Longtype) which details you want to fetch. Please use builder style:
GetMessagesResponse res = sdk.outgoing().getByIds() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call.
As a successful result aGetMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>withMessageobjects, each object per single found message.GetMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were found and returned correctly) andX-Error-Count(count of messages which were not found) elements.- Returns:
- The call builder
-
getByIds
public GetMessagesResponse getByIds(java.util.List<java.lang.Long> ids) throws java.lang.Exception
Get the messages details and status by IDs
Check the current status and details of one or more messages using theirids. You should pass theListOf()containing unique message IDs (Longtype) which details you want to fetch. Please use builder style:
GetMessagesResponse res = sdk.outgoing().getByIds() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call.
As a successful result aGetMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>withMessageobjects, each object per single found message.GetMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were found and returned correctly) andX-Error-Count(count of messages which were not found) elements.- Parameters:
ids- Listof Message IDs assigned by the system. The system will accept a maximum of 50 identifiers in one call. - Returns:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
getByIds
public GetMessagesResponse getByIds(java.util.List<java.lang.Long> ids, java.util.Optional<Options> options) throws java.lang.Exception
Get the messages details and status by IDs
Check the current status and details of one or more messages using theirids. You should pass theListOf()containing unique message IDs (Longtype) which details you want to fetch. Please use builder style:
GetMessagesResponse res = sdk.outgoing().getByIds() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call.
As a successful result aGetMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>withMessageobjects, each object per single found message.GetMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were found and returned correctly) andX-Error-Count(count of messages which were not found) elements.- Parameters:
ids- Listof Message IDs assigned by the system. The system will accept a maximum of 50 identifiers in one call. options- additional options- Returns:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
cancelScheduled
public CancelMessagesRequestBuilder cancelScheduled()
Cancel a scheduled messages
Cancel messages using theiridswhich were scheduled to be sent at a specific time. You have to pass aListOf()containing the unique message IDs (Longtype), which were returned after sending a message. Please use builder style:
CancelMessagesResponse res2 = sdk.outgoing().cancelScheduled() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call. You can cancel only messages with SCHEDULED status.As a successful result a
CancelMessagesResponseobject will be returned, withcancelledMessagesproperty of typeList<CancelledMessage>containingCancelledMessageobjects. Thestatusproperty of eachCancelledMessageobject will contain a status code of operation -204if a particular message was cancelled successfully and other code if an error occured.CancelMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were cancelled successfully),X-Error-Count(count of messages which were not cancelled) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Returns:
- The call builder
-
cancelScheduled
public CancelMessagesResponse cancelScheduled(java.util.List<java.lang.Long> ids) throws java.lang.Exception
Cancel a scheduled messages
Cancel messages using theiridswhich were scheduled to be sent at a specific time. You have to pass aListOf()containing the unique message IDs (Longtype), which were returned after sending a message. Please use builder style:
CancelMessagesResponse res2 = sdk.outgoing().cancelScheduled() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call. You can cancel only messages with SCHEDULED status.As a successful result a
CancelMessagesResponseobject will be returned, withcancelledMessagesproperty of typeList<CancelledMessage>containingCancelledMessageobjects. Thestatusproperty of eachCancelledMessageobject will contain a status code of operation -204if a particular message was cancelled successfully and other code if an error occured.CancelMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were cancelled successfully),X-Error-Count(count of messages which were not cancelled) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Parameters:
ids- Listof Message IDs assigned by the system. The system will accept a maximum of 50 identifiers in one call. - Returns:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
cancelScheduled
public CancelMessagesResponse cancelScheduled(java.util.List<java.lang.Long> ids, java.util.Optional<Options> options) throws java.lang.Exception
Cancel a scheduled messages
Cancel messages using theiridswhich were scheduled to be sent at a specific time. You have to pass aListOf()containing the unique message IDs (Longtype), which were returned after sending a message. Please use builder style:
CancelMessagesResponse res2 = sdk.outgoing().cancelScheduled() .ids(List.of(43456L)) .call();
This method will accept maximum 50 identifiers in one call. You can cancel only messages with SCHEDULED status.As a successful result a
CancelMessagesResponseobject will be returned, withcancelledMessagesproperty of typeList<CancelledMessage>containingCancelledMessageobjects. Thestatusproperty of eachCancelledMessageobject will contain a status code of operation -204if a particular message was cancelled successfully and other code if an error occured.CancelMessagesResponseobject will also containheadersproperty where you can findX-Success-Count(a count of messages which were cancelled successfully),X-Error-Count(count of messages which were not cancelled) andX-Sandbox(if a request was made in Sandbox or Production system) elements.- Parameters:
ids- Listof Message IDs assigned by the system. The system will accept a maximum of 50 identifiers in one call. options- additional options- Returns:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
list
public ListMessagesRequestBuilder list()
Lists the history of sent messages
Get the details and current status of all of sent messages from your account message history. This method supports pagination so you have to pass apage(number of page with messages which you want to access,Longtype) and alimit(max of messages per page,Longtype) parameters. Please use builder style:
ListMessagesResponse res = sdk.outgoing().list() .page(1L) .limit(10L) .call();
Messages are fetched from the latest one. This method will accept maximum value of 50 aslimitparameter value.
As a successful result aListMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>with aMessageobjects, each object per single message.ListMessagesResponsewill also containheadersproperty where you can findX-Total-Results(a total count of all messages which are available in history on your account),X-Total-Pages(a total number of all pages with results),X-Current-Page(A current page number) andX-Limit(messages count per single page) elements.- Returns:
- The call builder
-
listDirect
public ListMessagesResponse listDirect() throws java.lang.Exception
Lists the history of sent messages
Get the details and current status of all of sent messages from your account message history. This method supports pagination so you have to pass apage(number of page with messages which you want to access,Longtype) and alimit(max of messages per page,Longtype) parameters. Please use builder style:
ListMessagesResponse res = sdk.outgoing().list() .page(1L) .limit(10L) .call();
Messages are fetched from the latest one. This method will accept maximum value of 50 aslimitparameter value.
As a successful result aListMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>with aMessageobjects, each object per single message.ListMessagesResponsewill also containheadersproperty where you can findX-Total-Results(a total count of all messages which are available in history on your account),X-Total-Pages(a total number of all pages with results),X-Current-Page(A current page number) andX-Limit(messages count per single page) elements.- Returns:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
list
public ListMessagesResponse list(java.util.Optional<java.lang.Long> page, java.util.Optional<java.lang.Long> limit, java.util.Optional<Options> options) throws java.lang.Exception
Lists the history of sent messages
Get the details and current status of all of sent messages from your account message history. This method supports pagination so you have to pass apage(number of page with messages which you want to access,Longtype) and alimit(max of messages per page,Longtype) parameters. Please use builder style:
ListMessagesResponse res = sdk.outgoing().list() .page(1L) .limit(10L) .call();
Messages are fetched from the latest one. This method will accept maximum value of 50 aslimitparameter value.
As a successful result aListMessagesResponseobject will be returned containingmessagesproperty of typeList<Message>with aMessageobjects, each object per single message.ListMessagesResponsewill also containheadersproperty where you can findX-Total-Results(a total count of all messages which are available in history on your account),X-Total-Pages(a total number of all pages with results),X-Current-Page(A current page number) andX-Limit(messages count per single page) elements.- Parameters:
page- Page number of resultslimit- Number of results on one pageoptions- additional options- Returns:
- The response from the API call
- Throws:
java.lang.Exception- if the API call fails
-
-