Package com.bandwidth.sdk.api
Class MessagesApi
java.lang.Object
com.bandwidth.sdk.api.MessagesApi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateMessage
(String accountId, MessageRequest messageRequest) Create Message Endpoint for sending text messages and picture messages using V2 messaging.okhttp3.Call
createMessageAsync
(String accountId, MessageRequest messageRequest, ApiCallback<Message> _callback) Create Message (asynchronously) Endpoint for sending text messages and picture messages using V2 messaging.okhttp3.Call
createMessageCall
(String accountId, MessageRequest messageRequest, ApiCallback _callback) Build call for createMessagecreateMessageWithHttpInfo
(String accountId, MessageRequest messageRequest) Create Message Endpoint for sending text messages and picture messages using V2 messaging.int
listMessages
(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount) List Messages Returns a list of messages based on query parameters.okhttp3.Call
listMessagesAsync
(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount, ApiCallback<MessagesList> _callback) List Messages (asynchronously) Returns a list of messages based on query parameters.okhttp3.Call
listMessagesCall
(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount, ApiCallback _callback) Build call for listMessageslistMessagesWithHttpInfo
(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount) List Messages Returns a list of messages based on query parameters.void
setApiClient
(ApiClient apiClient) void
setCustomBaseUrl
(String customBaseUrl) void
setHostIndex
(int hostIndex)
-
Constructor Details
-
MessagesApi
public MessagesApi() -
MessagesApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
createMessageCall
public okhttp3.Call createMessageCall(String accountId, MessageRequest messageRequest, ApiCallback _callback) throws ApiException Build call for createMessage- Parameters:
accountId
- Your Bandwidth Account ID. (required)messageRequest
- (required)_callback
- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException
- If fail to serialize the request body object- Http Response Details:
Status Code Description Response Headers 202 Accepted - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 406 Not Acceptable - 415 Unsupported Media Type - 429 Too Many Requests - 500 Internal Server Error -
-
createMessage
Create Message Endpoint for sending text messages and picture messages using V2 messaging.- Parameters:
accountId
- Your Bandwidth Account ID. (required)messageRequest
- (required)- Returns:
- Message
- Throws:
ApiException
- If fail to call the API, e.g. server error or cannot deserialize the response body- Http Response Details:
Status Code Description Response Headers 202 Accepted - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 406 Not Acceptable - 415 Unsupported Media Type - 429 Too Many Requests - 500 Internal Server Error -
-
createMessageWithHttpInfo
public ApiResponse<Message> createMessageWithHttpInfo(String accountId, MessageRequest messageRequest) throws ApiException Create Message Endpoint for sending text messages and picture messages using V2 messaging.- Parameters:
accountId
- Your Bandwidth Account ID. (required)messageRequest
- (required)- Returns:
- ApiResponse<Message>
- Throws:
ApiException
- If fail to call the API, e.g. server error or cannot deserialize the response body- Http Response Details:
Status Code Description Response Headers 202 Accepted - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 406 Not Acceptable - 415 Unsupported Media Type - 429 Too Many Requests - 500 Internal Server Error -
-
createMessageAsync
public okhttp3.Call createMessageAsync(String accountId, MessageRequest messageRequest, ApiCallback<Message> _callback) throws ApiException Create Message (asynchronously) Endpoint for sending text messages and picture messages using V2 messaging.- Parameters:
accountId
- Your Bandwidth Account ID. (required)messageRequest
- (required)_callback
- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException
- If fail to process the API call, e.g. serializing the request body object- Http Response Details:
Status Code Description Response Headers 202 Accepted - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 406 Not Acceptable - 415 Unsupported Media Type - 429 Too Many Requests - 500 Internal Server Error -
-
listMessagesCall
public okhttp3.Call listMessagesCall(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount, ApiCallback _callback) throws ApiException Build call for listMessages- Parameters:
accountId
- Your Bandwidth Account ID. (required)messageId
- The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional)sourceTn
- The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional)destinationTn
- The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional)messageStatus
- The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional)messageDirection
- The direction of the message. One of INBOUND OUTBOUND. (optional)carrierName
- The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional)messageType
- The type of message. Either sms or mms. (optional)errorCode
- The error code of the message. (optional)fromDateTime
- The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional)toDateTime
- The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional)campaignId
- The campaign ID of the message. (optional)sort
- The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional)pageToken
- A base64 encoded value used for pagination of results. (optional)limit
- The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional)limitTotalCount
- When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. (optional)_callback
- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException
- If fail to serialize the request body object- Http Response Details:
Status Code Description Response Headers 200 OK - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 415 Unsupported Media Type - 429 Too Many Requests - 500 Internal Server Error -
-
listMessages
public MessagesList listMessages(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount) throws ApiException List Messages Returns a list of messages based on query parameters.- Parameters:
accountId
- Your Bandwidth Account ID. (required)messageId
- The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional)sourceTn
- The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional)destinationTn
- The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional)messageStatus
- The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional)messageDirection
- The direction of the message. One of INBOUND OUTBOUND. (optional)carrierName
- The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional)messageType
- The type of message. Either sms or mms. (optional)errorCode
- The error code of the message. (optional)fromDateTime
- The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional)toDateTime
- The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional)campaignId
- The campaign ID of the message. (optional)sort
- The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional)pageToken
- A base64 encoded value used for pagination of results. (optional)limit
- The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional)limitTotalCount
- When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. (optional)- Returns:
- MessagesList
- Throws:
ApiException
- If fail to call the API, e.g. server error or cannot deserialize the response body- Http Response Details:
Status Code Description Response Headers 200 OK - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 415 Unsupported Media Type - 429 Too Many Requests - 500 Internal Server Error -
-
listMessagesWithHttpInfo
public ApiResponse<MessagesList> listMessagesWithHttpInfo(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount) throws ApiException List Messages Returns a list of messages based on query parameters.- Parameters:
accountId
- Your Bandwidth Account ID. (required)messageId
- The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional)sourceTn
- The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional)destinationTn
- The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional)messageStatus
- The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional)messageDirection
- The direction of the message. One of INBOUND OUTBOUND. (optional)carrierName
- The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional)messageType
- The type of message. Either sms or mms. (optional)errorCode
- The error code of the message. (optional)fromDateTime
- The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional)toDateTime
- The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional)campaignId
- The campaign ID of the message. (optional)sort
- The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional)pageToken
- A base64 encoded value used for pagination of results. (optional)limit
- The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional)limitTotalCount
- When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. (optional)- Returns:
- ApiResponse<MessagesList>
- Throws:
ApiException
- If fail to call the API, e.g. server error or cannot deserialize the response body- Http Response Details:
Status Code Description Response Headers 200 OK - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 415 Unsupported Media Type - 429 Too Many Requests - 500 Internal Server Error -
-
listMessagesAsync
public okhttp3.Call listMessagesAsync(String accountId, String messageId, String sourceTn, String destinationTn, MessageStatusEnum messageStatus, ListMessageDirectionEnum messageDirection, String carrierName, MessageTypeEnum messageType, Integer errorCode, String fromDateTime, String toDateTime, String campaignId, String sort, String pageToken, Integer limit, Boolean limitTotalCount, ApiCallback<MessagesList> _callback) throws ApiException List Messages (asynchronously) Returns a list of messages based on query parameters.- Parameters:
accountId
- Your Bandwidth Account ID. (required)messageId
- The ID of the message to search for. Special characters need to be encoded using URL encoding. Message IDs could come in different formats, e.g., 9e0df4ca-b18d-40d7-a59f-82fcdf5ae8e6 and 1589228074636lm4k2je7j7jklbn2 are valid message ID formats. Note that you must include at least one query parameter. (optional)sourceTn
- The phone number that sent the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional)destinationTn
- The phone number that received the message. Accepted values are: a single full phone number a comma separated list of full phone numbers (maximum of 10) or a single partial phone number (minimum of 5 characters e.g. '%2B1919'). (optional)messageStatus
- The status of the message. One of RECEIVED QUEUED SENDING SENT FAILED DELIVERED ACCEPTED UNDELIVERED. (optional)messageDirection
- The direction of the message. One of INBOUND OUTBOUND. (optional)carrierName
- The name of the carrier used for this message. Possible values include but are not limited to Verizon and TMobile. Special characters need to be encoded using URL encoding (i.e. AT&T should be passed as AT%26T). (optional)messageType
- The type of message. Either sms or mms. (optional)errorCode
- The error code of the message. (optional)fromDateTime
- The start of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional)toDateTime
- The end of the date range to search in ISO 8601 format. Uses the message receive time. The date range to search in is currently 14 days. (optional)campaignId
- The campaign ID of the message. (optional)sort
- The field and direction to sort by combined with a colon. Direction is either asc or desc. (optional)pageToken
- A base64 encoded value used for pagination of results. (optional)limit
- The maximum records requested in search result. Default 100. The sum of limit and after cannot be more than 10000. (optional)limitTotalCount
- When set to true, the response's totalCount field will have a maximum value of 10,000. When set to false, or excluded, this will give an accurate totalCount of all messages that match the provided filters. If you are experiencing latency, try using this parameter to limit your results. (optional)_callback
- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException
- If fail to process the API call, e.g. serializing the request body object- Http Response Details:
Status Code Description Response Headers 200 OK - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 415 Unsupported Media Type - 429 Too Many Requests - 500 Internal Server Error -
-