Package io.sendon.contacts
Class SendonContacts
java.lang.Object
io.sendon.base.SendonClient
io.sendon.contacts.SendonContacts
SendonContacts provides methods to interact with the Sendon Contacts API.
It allows adding, retrieving, and deleting phone numbers from the blocklist.
-
Field Summary
Fields inherited from class io.sendon.base.SendonClient
gson, httpClient -
Constructor Summary
ConstructorsConstructorDescriptionSendonContacts(String userId, String apiKey) Initializes the SendonContacts client with user credentials.SendonContacts(String userId, String apiKey, boolean useOkHttp) Initializes the SendonContacts client with user credentials and an option to use OkHttp. -
Method Summary
Modifier and TypeMethodDescriptionaddBlocklist(CreateBlocklistRequest request) Adds a phone number to the blocklist using a request object.addBlocklist(String phoneNumber) Adds a phone number to the blocklist.addBlocklist(String phoneNumber, String messageType, String senderNumber, String kakaoChannelId, String rcsChatbotId, String rcsBrandId) Adds a phone number to the blocklist with optional parameters.Creates a new builder for creating blocklist entries.deleteBlocklist(long blocklistId) Deletes a phone number from the blocklist by its block ID.getBlocklist(int cursor, int limit) Retrieves the blocklist with pagination support.getBlocklist(GetBlocklistRequest request) Retrieves the blocklist using a request object.getBlocklist(String senderNumber, String[] kakaoChannelIds, String[] blockTypes, String startDate, String endDate, Integer cursor, Integer limit) Retrieves the blocklist with advanced filtering and pagination support.Creates a new builder for retrieving blocklist entries.Methods inherited from class io.sendon.base.SendonClient
delete, get, parseJsonResponse, post, postImagesWithMultipartFormData, postImageWithMultipartFormData, postImageWithMultipartFormData, put
-
Constructor Details
-
SendonContacts
Initializes the SendonContacts client with user credentials.- Parameters:
userId- The user ID for authentication.apiKey- The API key for authentication.
-
SendonContacts
Initializes the SendonContacts client with user credentials and an option to use OkHttp.- Parameters:
userId- The user ID for authentication.apiKey- The API key for authentication.useOkHttp- Whether to use OkHttp for HTTP requests.
-
-
Method Details
-
addBlocklist
Adds a phone number to the blocklist.- Parameters:
phoneNumber- The phone number to be added to the blocklist.- Returns:
- An AddBlocklist object containing the API response, or null if an error occurs.
-
addBlocklist
public AddBlocklist addBlocklist(String phoneNumber, String messageType, String senderNumber, String kakaoChannelId, String rcsChatbotId, String rcsBrandId) Adds a phone number to the blocklist with optional parameters.- Parameters:
phoneNumber- The phone number to be added to the blocklist.messageType- The message type (SMS, KAKAO, RCS). Default is SMS.senderNumber- The sender number to block from.kakaoChannelId- The Kakao channel ID for Kakao message blocking.rcsChatbotId- The RCS chatbot ID for RCS message blocking.rcsBrandId- The RCS brand ID for RCS message blocking.- Returns:
- An AddBlocklist object containing the API response, or null if an error occurs.
-
addBlocklist
Adds a phone number to the blocklist using a request object.- Parameters:
request- The CreateBlocklistRequest object containing all parameters.- Returns:
- An AddBlocklist object containing the API response, or null if an error occurs.
-
getBlocklist
Retrieves the blocklist with pagination support.- Parameters:
cursor- The cursor for pagination.limit- The maximum number of entries to retrieve.- Returns:
- A GetBlocklist object containing the API response, or null if an error occurs.
-
getBlocklist
public GetBlocklist getBlocklist(String senderNumber, String[] kakaoChannelIds, String[] blockTypes, String startDate, String endDate, Integer cursor, Integer limit) Retrieves the blocklist with advanced filtering and pagination support.- Parameters:
senderNumber- Filter by specific sender number.kakaoChannelIds- Array of Kakao channel IDs to filter by.blockTypes- Array of block types (WEB, API, ARS) to filter by.startDate- Start date for filtering (YYYY-MM-DD HH:mm:ss format).endDate- End date for filtering (YYYY-MM-DD HH:mm:ss format).cursor- The cursor for pagination (default: 0).limit- The maximum number of entries to retrieve (default: 20).- Returns:
- A GetBlocklist object containing the API response, or null if an error occurs.
-
getBlocklist
Retrieves the blocklist using a request object.- Parameters:
request- The GetBlocklistRequest object containing all filter and pagination parameters.- Returns:
- A GetBlocklist object containing the API response, or null if an error occurs.
-
deleteBlocklist
Deletes a phone number from the blocklist by its block ID.- Parameters:
blocklistId- The ID of the blocklist entry to delete.- Returns:
- A DeleteBlocklist object containing the API response, or null if an error occurs.
-
createBlocklistBuilder
Creates a new builder for creating blocklist entries. Provides a fluent API for configuring blocklist creation requests.- Returns:
- A new
ContactBuilder.CreateBlocklistBuilderinstance.
-
getBlocklistBuilder
Creates a new builder for retrieving blocklist entries. Provides a fluent API for configuring blocklist retrieval requests with filtering and pagination.- Returns:
- A new
ContactBuilder.GetBlocklistBuilderinstance.
-