public class MessageBirdClient extends Object
Initialise this class with a MessageBirdService // First create your service object MessageBirdService wsr = new MessageBirdServiceImpl(args[0]); // Add the service to the client MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); Then read your balance like this: final Balance balance = messageBirdClient.getBalance();
Created by rvt on 1/5/15.
| Constructor and Description |
|---|
MessageBirdClient(MessageBirdService messageBirdService) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelNumber(String number)
Cancels a particular number.
|
ChildAccountCreateResponse |
createChildAccount(ChildAccountRequest childAccountRequest)
Function to create a child account
|
TranscriptionResponse |
createTranscription(String callID,
String legId,
String recordingId,
String language)
Function to view recording by call id , leg id and recording id
|
WebhookResponseData |
createWebhook(Webhook webhook)
Function to create a webhook
|
TemplateResponse |
createWhatsAppTemplate(Template template)
Create a WhatsApp message template through messagebird.
|
void |
deleteChildAccount(String id)
Function to delete a child account
|
void |
deleteConversationWebhook(String webhookId)
Deletes a webhook.
|
void |
deleteGroup(String id)
Deletes an existing group.
|
void |
deleteGroupContact(String groupId,
String contactId)
Removes a contact from group.
|
void |
deleteMessage(String id)
Delete a message from the Messagebird server
|
void |
deleteRecording(String callID,
String legID,
String recordingID)
Deletes a voice recording
|
void |
deleteTemplatesBy(String templateName)
Delete templates of an existing template name.
|
void |
deleteVerifyObject(String id) |
void |
deleteVoiceCall(String id)
Function to delete voice call by id
|
void |
deleteVoiceCallFlow(String id)
Convenient function to delete call flow
|
void |
deleteVoiceMessage(String id)
Delete a voice message from the Messagebird server
|
void |
deleteWebhook(String id)
Function to delete a webhook
|
String |
downloadFile(String id,
String filename,
String basePath)
Downloads a file and stores it with the provided filename in the basePath directory.
|
String |
downloadRecording(String callID,
String legId,
String recordingId,
String basePath)
Downloads the record in .wav format by using callId, legId and recordId and stores to basePath.
|
String |
downloadTranscription(String callID,
String legId,
String recordingId,
String transcriptionId,
String basePath)
Downloads the transcription in .txt format by using callId, legId, recordId and transcriptionId and stores to basePath.
|
TemplateResponse |
fetchWhatsAppTemplateBy(String templateName,
String language)
Retrieves the template of an existing template name and language under the first waba connected to the requesting user.
|
TemplateResponse |
fetchWhatsAppTemplateBy(String templateName,
String language,
String wabaID,
String channelID)
Retrieves the template of an existing template name and language under a WABA or for a channel.
|
Balance |
getBalance()
MessageBird provides an API to get the balance information of your account.
|
ChildAccountDetailedResponse |
getChildAccountById(String id)
Function to get a child account
|
List<ChildAccountResponse> |
getChildAccounts(Integer offset,
Integer limit)
Function to get a child account
|
OutboundSmsPriceResponse |
getOutboundSmsPrices()
Returns outbound pricing for the default SMS configuration for the authenticated account.
|
OutboundSmsPriceResponse |
getOutboundSmsPrices(String smppUsername)
Returns outbound SMS pricing for a specific SMPP username.
|
Hlr |
getRequestHlr(BigInteger msisdn,
String reference)
MessageBird provides an API to send Network Queries to any mobile number across the world.
|
VerifyMessage |
getVerifyEmailMessage(String messageId) |
Verify |
getVerifyObject(String id) |
Hlr |
getViewHlr(String hlrId)
Retrieves the information of an existing HLR.
|
List<TemplateResponse> |
getWhatsAppTemplatesBy(String templateName)
Retrieves the template of an existing template name.
|
List<TemplateResponse> |
getWhatsAppTemplatesBy(String templateName,
String wabaID,
String channelID)
Retrieves the template of an existing template name.
|
VoiceCallResponseList |
listAllVoiceCalls(Integer page,
Integer pageSize)
Function to list all voice calls
|
ContactList |
listContacts()
Gets a contact listing with default pagination options.
|
ContactList |
listContacts(int offset,
int limit)
Gets a contact listing with specified pagination options.
|
ConversationMessageList |
listConversationMessages(String conversationId)
Gets a ConversationMessage listing with default pagination options.
|
ConversationMessageList |
listConversationMessages(String conversationId,
int offset,
int limit)
Gets a ConversationMessage listing with specified pagination options.
|
ConversationMessageList |
listConversationMessagesWithQueryParam(Map<String,Object> queryParams)
Gets conversation messages based on query param.
|
ConversationList |
listConversations()
Gets a contact listing with default pagination options.
|
ConversationList |
listConversations(int offset,
int limit)
Gets a Conversation listing with specified pagination options.
|
ConversationWebhookList |
listConversationWebhooks()
Gets a ConversationWebhook listing with default pagination options.
|
ConversationWebhookList |
listConversationWebhooks(int offset,
int limit)
Gets a ConversationWebhook listing with the specified pagination options.
|
GroupList |
listGroups()
Gets a contact listing with default pagination options.
|
GroupList |
listGroups(int offset,
int limit)
Gets a contact listing with specified pagination options.
|
MessageList |
listMessages(Integer offset,
Integer limit) |
MessageList |
listMessagesFiltered(Integer offset,
Integer limit,
Map<String,Object> filters) |
PhoneNumbersResponse |
listNumbersForPurchase(String countryCode)
Lists Numbers that are available to purchase in a particular country code, without any filters.
|
PhoneNumbersResponse |
listNumbersForPurchase(String countryCode,
PhoneNumbersLookup params)
Lists Numbers that are available to purchase in a particular country code, according to specified search criteria.
|
PurchasedNumbersResponse |
listPurchasedNumbers(PurchasedNumbersFilter filter)
Lists Numbers that were purchased using the account credentials that the client was initialized with.
|
RecordingResponse |
listRecordings(String callID,
String legId,
Integer offset,
Integer limit)
List the all recordings related to CallID and LegId
|
TranscriptionResponse |
listTranscriptions(String callID,
String legId,
String recordingId,
Integer page,
Integer pageSize)
Lists the Transcription of callId, legId and recordId
|
VoiceCallFlowList |
listVoiceCallFlows(Integer offset,
Integer limit)
Convenient function to list all call flows
|
VoiceMessageList |
listVoiceMessages(Integer offset,
Integer limit)
List voice messages
|
WebhookList |
listWebhooks(Integer offset,
Integer limit)
Function to list webhooks
|
TemplateList |
listWhatsAppTemplates()
Gets a template listing with default pagination options.
|
TemplateList |
listWhatsAppTemplates(int offset,
int limit)
Gets a WhatsAppTemplate listing with specified pagination options.
|
TemplateList |
listWhatsAppTemplates(int offset,
int limit,
String wabaID,
String channelID)
Gets a WhatsAppTemplate listing with specified pagination options and a wabaID or channelID filter.
|
PurchasedNumberCreatedResponse |
purchaseNumber(String number,
String countryCode,
int billingIntervalMonths)
Purchases a phone number.
|
LookupHlr |
requestLookupHlr(BigInteger phoneNumber,
String reference)
Request a Lookup HLR (lookup)
|
LookupHlr |
requestLookupHlr(LookupHlr lookupHlr)
Request a Lookup HLR (lookup)
|
Contact |
sendContact(ContactRequest contactRequest)
Creates a new contact object.
|
ConversationMessage |
sendConversationMessage(String conversationId,
ConversationMessageRequest request)
Sends a message to an existing Conversation.
|
ConversationWebhook |
sendConversationWebhook(ConversationWebhookCreateRequest request)
Creates a new webhook.
|
MessageResponse |
sendFlashMessage(String originator,
String body,
List<BigInteger> recipients)
Convenient function to send a simple flash message to a list of recipients
|
MessageResponse |
sendFlashMessage(String originator,
String body,
List<BigInteger> recipients,
String reference)
Convenient function to send a simple flash message to a list of recipients
|
Group |
sendGroup(GroupRequest groupRequest)
Creates a new group object.
|
void |
sendGroupContact(String groupId,
String[] contactIds)
Adds contact to group.
|
ConversationSendResponse |
sendMessage(ConversationSendRequest request)
sendMessage allows you to send message to users over any communication platform supported by Programmable Conversations
|
MessageResponse |
sendMessage(Message message)
Send a message through the messagebird platform
|
MessageResponse |
sendMessage(String originator,
String body,
List<BigInteger> recipients)
Convenient function to send a simple message to a list of recipients
|
MessageResponse |
sendMessage(String originator,
String body,
List<BigInteger> recipients,
String reference)
Convenient function to send a simple message to a list of recipients
|
Verify |
sendVerifyToken(String recipient) |
Verify |
sendVerifyToken(VerifyRequest verifyRequest) |
VoiceCallResponse |
sendVoiceCall(VoiceCall voiceCall)
Function for voice call to a number
|
VoiceCallFlowResponse |
sendVoiceCallFlow(VoiceCallFlowRequest voiceCallFlowRequest)
Convenient function to create a call flow
|
VoiceMessageResponse |
sendVoiceMessage(String body,
List<BigInteger> recipients)
Convenient function to send a simple message to a list of recipients
|
VoiceMessageResponse |
sendVoiceMessage(String body,
List<BigInteger> recipients,
String reference)
Convenient function to send a simple message to a list of recipients
|
VoiceMessageResponse |
sendVoiceMessage(VoiceMessage voiceMessage)
Convenient function to send a simple message to a list of recipients
|
Conversation |
startConversation(ConversationStartRequest request)
Starts a conversation by sending an initial message.
|
ChildAccountResponse |
updateChildAccount(String name,
String id)
Function to update a child account
|
Contact |
updateContact(String id,
ContactRequest contactRequest)
Updates an existing contact.
|
Conversation |
updateConversation(String id,
ConversationStatus status)
Updates a conversation.
|
ConversationWebhook |
updateConversationWebhook(String id,
ConversationWebhookUpdateRequest request)
Update an existing webhook.
|
Group |
updateGroup(String id,
GroupRequest groupRequest)
Updates an existing group.
|
PurchasedNumber |
updateNumber(String number,
String... tags)
Updates tags on a particular existing Number.
|
VoiceCallFlowResponse |
updateVoiceCallFlow(String id,
VoiceCallFlowRequest voiceCallFlowRequest)
Updates an existing Call Flow.
|
WebhookResponseData |
updateWebhook(String id,
Webhook webhook)
Function to update a webhook
|
TemplateResponse |
updateWhatsAppTemplate(Template template,
String templateName,
String language)
Update a WhatsApp message template through MessageBird.
|
FileUploadResponse |
uploadFile(byte[] binary,
String contentType,
String filename)
Uploads a file and returns the assigned ID.
|
Verify |
verifyToken(String id,
String token) |
VoiceCallLeg |
viewCallLegByCallIdAndLegId(String callId,
String legId)
Retrieves a leg resource.
|
VoiceCallLegResponse |
viewCallLegsByCallId(String callId,
Integer page,
Integer pageSize)
Retrieves a listing of all legs.
|
Contact |
viewContact(String id)
Retrieves the information of an existing contact.
|
Conversation |
viewConversation(String id)
Gets a single conversation.
|
ConversationMessage |
viewConversationMessage(String messageId)
Gets a single message.
|
ConversationWebhook |
viewConversationWebhook(String webhookId)
Gets a single webhook.
|
Group |
viewGroup(String id)
Retrieves the information of an existing group.
|
Lookup |
viewLookup(BigInteger phoneNumber)
Send a Lookup request
|
Lookup |
viewLookup(Lookup lookup)
Send a Lookup request
|
LookupHlr |
viewLookupHlr(BigInteger phoneNumber)
View a Lookup HLR (lookup)
|
LookupHlr |
viewLookupHlr(LookupHlr lookupHlr)
View a Lookup HLR (lookup)
|
MessageResponse |
viewMessage(String id)
View a message from the Messagebird server
|
PurchasedNumber |
viewPurchasedNumber(String number)
Returns a Number that has already been purchased on the initialized account.
|
RecordingResponse |
viewRecording(String callID,
String legId,
String recordingId)
Function to view recording by call id , leg id and recording id
|
TranscriptionResponse |
viewTranscription(String callID,
String legId,
String recordingId,
String transcriptionId)
Function to view recording by call id, leg id and recording id
|
VoiceCallResponse |
viewVoiceCall(String id)
Function to view voice call by id
|
VoiceCallFlowResponse |
viewVoiceCallFlow(String id)
Retrieves the information of an existing Call Flow.
|
VoiceMessageResponse |
viewVoiceMessage(String id)
View a message from the Messagebird server
|
WebhookResponseData |
viewWebhook(String id)
Function to view a webhook
|
public MessageBirdClient(MessageBirdService messageBirdService)
public Balance getBalance() throws GeneralException, UnauthorizedException, NotFoundException
UnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic Hlr getRequestHlr(BigInteger msisdn, String reference) throws GeneralException, UnauthorizedException
msisdn - The telephone number.reference - A client referenceUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic Hlr getViewHlr(String hlrId) throws GeneralException, UnauthorizedException, NotFoundException
hlrId - ID as returned by getRequestHlr in the id variableUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic MessageResponse sendMessage(Message message) throws UnauthorizedException, GeneralException
message - Message object to be sendUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic MessageResponse sendMessage(String originator, String body, List<BigInteger> recipients) throws UnauthorizedException, GeneralException
originator - Originator of the message, this will get truncated to 11 charsbody - Body of the messagerecipients - List of recipientsUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic MessageResponse sendMessage(String originator, String body, List<BigInteger> recipients, String reference) throws UnauthorizedException, GeneralException
originator - Originator of the message, this will get truncated to 11 charsbody - Body of the messagerecipients - List of recipientsreference - your referenceUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic MessageResponse sendFlashMessage(String originator, String body, List<BigInteger> recipients) throws UnauthorizedException, GeneralException
originator - Originator of the message, this will get truncated to 11 charsbody - Body of the messagerecipients - List of recipientsUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic MessageResponse sendFlashMessage(String originator, String body, List<BigInteger> recipients, String reference) throws UnauthorizedException, GeneralException
originator - Originator of the message, this will get truncated to 11 charsbody - Body of the messagerecipients - List of recipientsreference - your referenceUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic MessageList listMessages(Integer offset, Integer limit) throws UnauthorizedException, GeneralException
public MessageList listMessagesFiltered(Integer offset, Integer limit, Map<String,Object> filters) throws UnauthorizedException, GeneralException
public void deleteMessage(String id) throws UnauthorizedException, GeneralException, NotFoundException
id - A unique random ID which is created on the MessageBird platformUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic MessageResponse viewMessage(String id) throws UnauthorizedException, GeneralException, NotFoundException
id - A unique random ID which is created on the MessageBird platformUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic VoiceMessageResponse sendVoiceMessage(VoiceMessage voiceMessage) throws UnauthorizedException, GeneralException
voiceMessage - Voice message objectUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic VoiceMessageResponse sendVoiceMessage(String body, List<BigInteger> recipients) throws UnauthorizedException, GeneralException
body - Body of the messagerecipients - List of recipientsUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic VoiceMessageResponse sendVoiceMessage(String body, List<BigInteger> recipients, String reference) throws UnauthorizedException, GeneralException
body - Body of the messagerecipients - List of recipientsreference - your referenceUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic void deleteVoiceMessage(String id) throws UnauthorizedException, GeneralException, NotFoundException
id - A unique random ID which is created on the MessageBird platformUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic VoiceMessageResponse viewVoiceMessage(String id) throws UnauthorizedException, GeneralException, NotFoundException
id - A unique random ID which is created on the MessageBird platformUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic VoiceMessageList listVoiceMessages(Integer offset, Integer limit) throws UnauthorizedException, GeneralException
offset - offset for result listlimit - limit for result listUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic Verify sendVerifyToken(VerifyRequest verifyRequest) throws UnauthorizedException, GeneralException
verifyRequest - includes recipient, originator, reference, type, datacoding, template, timeout, tokenLenght, voice, languageUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic Verify sendVerifyToken(String recipient) throws UnauthorizedException, GeneralException
recipient - The telephone number that you want to verify.UnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic Verify verifyToken(String id, String token) throws NotFoundException, GeneralException, UnauthorizedException
id - A unique random ID which is created on the MessageBird platformtoken - An unique token which was sent to the recipient upon creation of the object.NotFoundException - if id is not foundUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic Verify getVerifyObject(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - id is for getting verify objectNotFoundException - if id is not foundUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic VerifyMessage getVerifyEmailMessage(String messageId) throws UnauthorizedException, GeneralException, NotFoundException
messageId - is for the email message part of a verify objectNotFoundException - if id is not foundUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic void deleteVerifyObject(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - id for deleting verify objectNotFoundException - if id is not foundUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic Lookup viewLookup(Lookup lookup) throws UnauthorizedException, GeneralException, NotFoundException
lookup - including with country code, country prefix, phone number, type, formats, country codeUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if lookup not foundpublic Lookup viewLookup(BigInteger phoneNumber) throws UnauthorizedException, GeneralException, NotFoundException
phoneNumber - phone number is for viewing lookupUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic LookupHlr requestLookupHlr(LookupHlr lookupHlr) throws UnauthorizedException, GeneralException
lookupHlr - country code for request lookup hlrUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic LookupHlr requestLookupHlr(BigInteger phoneNumber, String reference) throws UnauthorizedException, GeneralException
phoneNumber - phone number is for request hlrreference - reference for request hlrUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic LookupHlr viewLookupHlr(LookupHlr lookupHlr) throws UnauthorizedException, GeneralException, NotFoundException
lookupHlr - search with country codeUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if there is no lookup hlr with given country codepublic LookupHlr viewLookupHlr(BigInteger phoneNumber) throws UnauthorizedException, GeneralException, NotFoundException
phoneNumber - phone number for searching on hlrUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - phone number not found on hlrpublic VoiceCallFlowList listVoiceCallFlows(Integer offset, Integer limit) throws UnauthorizedException, GeneralException
offset - limit - UnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic VoiceCallFlowResponse viewVoiceCallFlow(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - StringNotFoundExceptionGeneralExceptionUnauthorizedExceptionpublic VoiceCallFlowResponse sendVoiceCallFlow(VoiceCallFlowRequest voiceCallFlowRequest) throws UnauthorizedException, GeneralException
voiceCallFlowRequest - VoiceCallFlowRequestUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic VoiceCallFlowResponse updateVoiceCallFlow(String id, VoiceCallFlowRequest voiceCallFlowRequest) throws UnauthorizedException, GeneralException
id - StringvoiceCallFlowRequest - VoiceCallFlowRequestUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic void deleteVoiceCallFlow(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - StringUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic ContactList listContacts(int offset, int limit) throws UnauthorizedException, GeneralException
UnauthorizedExceptionGeneralExceptionpublic ContactList listContacts() throws UnauthorizedException, GeneralException
public Contact sendContact(ContactRequest contactRequest) throws UnauthorizedException, GeneralException
public Contact updateContact(String id, ContactRequest contactRequest) throws UnauthorizedException, GeneralException
public Contact viewContact(String id) throws NotFoundException, GeneralException, UnauthorizedException
public void deleteGroup(String id) throws NotFoundException, GeneralException, UnauthorizedException
public void deleteGroupContact(String groupId, String contactId) throws NotFoundException, GeneralException, UnauthorizedException
public GroupList listGroups(int offset, int limit) throws UnauthorizedException, GeneralException
public GroupList listGroups() throws UnauthorizedException, GeneralException
public Group sendGroup(GroupRequest groupRequest) throws UnauthorizedException, GeneralException
public void sendGroupContact(String groupId, String[] contactIds) throws NotFoundException, GeneralException, UnauthorizedException
public Group updateGroup(String id, GroupRequest groupRequest) throws UnauthorizedException, GeneralException
public Group viewGroup(String id) throws NotFoundException, GeneralException, UnauthorizedException
public Conversation viewConversation(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - Conversation to retrieved.NotFoundExceptionGeneralExceptionUnauthorizedExceptionpublic Conversation updateConversation(String id, ConversationStatus status) throws UnauthorizedException, GeneralException
id - Conversation to update.status - New status for the conversation.UnauthorizedExceptionGeneralExceptionpublic ConversationList listConversations(int offset, int limit) throws UnauthorizedException, GeneralException
offset - Number of objects to skip.limit - Number of objects to take.UnauthorizedExceptionGeneralExceptionpublic ConversationList listConversations() throws UnauthorizedException, GeneralException
UnauthorizedExceptionGeneralExceptionpublic Conversation startConversation(ConversationStartRequest request) throws UnauthorizedException, GeneralException
request - Data for this request.UnauthorizedExceptionGeneralExceptionpublic ConversationSendResponse sendMessage(ConversationSendRequest request) throws UnauthorizedException, GeneralException
request - Data for this request.UnauthorizedExceptionGeneralExceptionpublic ConversationMessageList listConversationMessages(String conversationId, int offset, int limit) throws UnauthorizedException, GeneralException
conversationId - Conversation to get messages for.offset - Number of objects to skip.limit - Number of objects to take.UnauthorizedExceptionGeneralExceptionpublic ConversationMessageList listConversationMessages(String conversationId) throws UnauthorizedException, GeneralException
conversationId - Conversation to get messages for.UnauthorizedExceptionGeneralExceptionpublic ConversationMessage viewConversationMessage(String messageId) throws NotFoundException, GeneralException, UnauthorizedException
messageId - Message to retrieve.NotFoundExceptionGeneralExceptionUnauthorizedExceptionpublic ConversationMessageList listConversationMessagesWithQueryParam(Map<String,Object> queryParams) throws NotFoundException, GeneralException, UnauthorizedException
queryParams - only `ids` and `from` is available as an optionNotFoundExceptionGeneralExceptionUnauthorizedExceptionpublic ConversationMessage sendConversationMessage(String conversationId, ConversationMessageRequest request) throws UnauthorizedException, GeneralException
conversationId - Conversation to send message to.request - Message to send.UnauthorizedExceptionGeneralExceptionpublic void deleteConversationWebhook(String webhookId) throws NotFoundException, GeneralException, UnauthorizedException
webhookId - Webhook to delete.NotFoundExceptionGeneralExceptionUnauthorizedExceptionpublic ConversationWebhook sendConversationWebhook(ConversationWebhookCreateRequest request) throws UnauthorizedException, GeneralException
request - Webhook to create.UnauthorizedExceptionGeneralExceptionpublic ConversationWebhook updateConversationWebhook(String id, ConversationWebhookUpdateRequest request) throws UnauthorizedException, GeneralException
request - update request.UnauthorizedExceptionGeneralExceptionpublic ConversationWebhook viewConversationWebhook(String webhookId) throws NotFoundException, GeneralException, UnauthorizedException
webhookId - Webhook to retrieve.NotFoundExceptionGeneralExceptionUnauthorizedExceptionpublic ConversationWebhookList listConversationWebhooks(int offset, int limit) throws UnauthorizedException, GeneralException
offset - Number of objects to skip.limit - Number of objects to skip.UnauthorizedExceptionGeneralExceptionpublic ConversationWebhookList listConversationWebhooks() throws UnauthorizedException, GeneralException
UnauthorizedExceptionGeneralExceptionpublic VoiceCallResponse sendVoiceCall(VoiceCall voiceCall) throws UnauthorizedException, GeneralException
voiceCall - Voice call objectUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic VoiceCallResponseList listAllVoiceCalls(Integer page, Integer pageSize) throws GeneralException, UnauthorizedException
UnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic VoiceCallResponse viewVoiceCall(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - Voice call IDUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic void deleteVoiceCall(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - Voice call IDUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize) throws UnsupportedEncodingException, UnauthorizedException, GeneralException
callId - Voice call IDpage - page to fetch (can be null - will return first page), number of first page is 1pageSize - page sizeUnsupportedEncodingException - no UTF8 supported urlUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic VoiceCallLeg viewCallLegByCallIdAndLegId(String callId, String legId) throws UnsupportedEncodingException, NotFoundException, GeneralException, UnauthorizedException
callId - Voice call IDlegId - ID of leg of specified call {callId}UnsupportedEncodingException - no UTF8 supported urlNotFoundException - not found with callId and legIdUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic RecordingResponse viewRecording(String callID, String legId, String recordingId) throws NotFoundException, GeneralException, UnauthorizedException
callID - Voice call IDlegId - Leg IDrecordingId - Recording IDNotFoundException - not found with callId and legIdUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic String downloadRecording(String callID, String legId, String recordingId, String basePath) throws NotFoundException, GeneralException, UnauthorizedException
callID - Voice call IDlegId - Leg IDrecordingId - Recording IDbasePath - store location. It should be directory. Property is Optional if $HOME is accessibleNotFoundException - if the recording does not foundGeneralException - general exceptionUnauthorizedException - if client is unauthorizedpublic RecordingResponse listRecordings(String callID, String legId, Integer offset, Integer limit) throws GeneralException, UnauthorizedException
callID - Voice call IDlegId - Leg IDoffset - Number of objects to skip.limit - Number of objects to take.GeneralException - if client is unauthorizedUnauthorizedException - general exceptionpublic void deleteRecording(String callID, String legID, String recordingID) throws NotFoundException, GeneralException, UnauthorizedException
callID - Voice call IDlegID - Leg IDrecordingID - Recording IDUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic TranscriptionResponse createTranscription(String callID, String legId, String recordingId, String language) throws UnauthorizedException, GeneralException
callID - Voice call IDlegId - Leg IDrecordingId - Recording IDlanguage - LanguageUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId) throws UnauthorizedException, GeneralException, NotFoundException
callID - Voice call IDlegId - Leg IDrecordingId - Recording IDtranscriptionId - Transcription IDUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - If transcription is not foundpublic TranscriptionResponse listTranscriptions(String callID, String legId, String recordingId, Integer page, Integer pageSize) throws UnauthorizedException, GeneralException
callID - Voice call IDlegId - Leg IDrecordingId - Recording IDpage - page to fetch (can be null - will return first page), number of first page is 1pageSize - page sizeUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic String downloadTranscription(String callID, String legId, String recordingId, String transcriptionId, String basePath) throws UnauthorizedException, GeneralException, NotFoundException
callID - Voice call IDlegId - Leg IDrecordingId - Recording IDtranscriptionId - Transcription IDbasePath - store location. It should be directory. Property is Optional if $HOME is accessibleNotFoundException - if the recording does not foundGeneralException - general exceptionUnauthorizedException - if client is unauthorizedpublic WebhookResponseData createWebhook(Webhook webhook) throws UnauthorizedException, GeneralException
webhook - webhook to createUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic WebhookResponseData updateWebhook(String id, Webhook webhook) throws UnauthorizedException, GeneralException
webhook - webhook fields to updateUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic WebhookResponseData viewWebhook(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - id of a webhookUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundExceptionpublic WebhookList listWebhooks(Integer offset, Integer limit) throws UnauthorizedException, GeneralException
offset - offset for result listlimit - limit for result listUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic void deleteWebhook(String id) throws NotFoundException, GeneralException, UnauthorizedException
id - A unique random ID which is created on the MessageBird platformNotFoundException - if id is not foundGeneralException - general exceptionUnauthorizedException - if client is unauthorizedpublic PhoneNumbersResponse listNumbersForPurchase(String countryCode) throws GeneralException, UnauthorizedException, NotFoundException, IllegalArgumentException
countryCode - The country code in which the Number should be purchased.GeneralException - general exceptionUnauthorizedException - if client is unauthorizedNotFoundException - if the resource is missingIllegalArgumentException - if the country code provided is invalidpublic PhoneNumbersResponse listNumbersForPurchase(String countryCode, PhoneNumbersLookup params) throws GeneralException, UnauthorizedException, NotFoundException, IllegalArgumentException
countryCode - The country code in which the Number should be purchased.params - Parameters to filter the resulting phone numbers returned.GeneralException - general exceptionUnauthorizedException - if client is unauthorizedNotFoundException - if the resource is missingIllegalArgumentException - if the country code provided is invalidpublic PurchasedNumberCreatedResponse purchaseNumber(String number, String countryCode, int billingIntervalMonths) throws UnauthorizedException, GeneralException, IllegalArgumentException
number - The number to purchase.countryCode - The country code in which the Number should be purchased.GeneralException - general exceptionUnauthorizedException - if client is unauthorizedIllegalArgumentException - if the country code provided is invalidpublic PurchasedNumbersResponse listPurchasedNumbers(PurchasedNumbersFilter filter) throws UnauthorizedException, GeneralException, NotFoundException
filter - Filters the list of purchased numbers according to search criteria.UnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if the resource is missingpublic PurchasedNumber viewPurchasedNumber(String number) throws UnauthorizedException, GeneralException, NotFoundException
number - The number whose data should be returned.UnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if the Number is missingpublic PurchasedNumber updateNumber(String number, String... tags) throws UnauthorizedException, GeneralException
number - The number to update.tags - A tag to apply to the number.UnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic void cancelNumber(String number) throws UnauthorizedException, GeneralException, NotFoundException
number - The number to cancel.GeneralException - general exceptionUnauthorizedException - if client is unauthorizedNotFoundException - if the resource is missingpublic FileUploadResponse uploadFile(byte[] binary, String contentType, String filename) throws GeneralException, UnauthorizedException
binary - the bytes of the file to upload.contentType - the content type of the file (e.g. "image/png").filename - optional filename to set in the upload request headers.GeneralException - general exceptionUnauthorizedException - if client is unauthorizeddownloadFile(java.lang.String, java.lang.String, java.lang.String)public String downloadFile(String id, String filename, String basePath) throws GeneralException, UnauthorizedException, NotFoundException
id - the ID of the file, provided when the file was uploadedbasePath - store location. It should be a directory. Property is nullable if $HOME is accessiblefilename - the name of the file to download to.NotFoundException - if the file does not existGeneralException - general exceptionUnauthorizedException - if client is unauthorizeduploadFile(byte[], java.lang.String, java.lang.String)public TemplateResponse createWhatsAppTemplate(Template template) throws UnauthorizedException, GeneralException, IllegalArgumentException
template - Template object to be createdTemplateResponse response objectUnauthorizedException - if client is unauthorizedGeneralException - general exceptionIllegalArgumentException - invalid template formatpublic TemplateResponse updateWhatsAppTemplate(Template template, String templateName, String language) throws UnauthorizedException, GeneralException, IllegalArgumentException
template - Template object to be createdtemplateName - A name as returned by getWhatsAppTemplateBy in the name variablelanguage - A language code as returned by getWhatsAppTemplateBy in the language variableTemplateResponse response objectUnauthorizedException - if client is unauthorizedGeneralException - general exceptionIllegalArgumentException - invalid template formatpublic TemplateList listWhatsAppTemplates(int offset, int limit) throws UnauthorizedException, GeneralException
offset - Number of objects to skip.limit - Number of objects to take.UnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic TemplateList listWhatsAppTemplates(int offset, int limit, String wabaID, String channelID) throws UnauthorizedException, GeneralException, IllegalArgumentException
offset - Number of objects to skip.limit - Number of objects to take.wabaID - The WABA ID to filter templates by.channelID - A channel ID filter to return only templates that can be sent via that channel.UnauthorizedException - if client is unauthorizedGeneralException - general exceptionIllegalArgumentException - if the provided arguments are not validpublic TemplateList listWhatsAppTemplates() throws UnauthorizedException, GeneralException
UnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic List<TemplateResponse> getWhatsAppTemplatesBy(String templateName) throws GeneralException, UnauthorizedException, NotFoundException, IllegalArgumentException
templateName - A name as returned by getWhatsAppTemplateBy in the name variableList<TemplateResponse> template listUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if template name is not foundIllegalArgumentException - if the provided arguments are not validpublic List<TemplateResponse> getWhatsAppTemplatesBy(String templateName, String wabaID, String channelID) throws GeneralException, UnauthorizedException, NotFoundException, IllegalArgumentException
templateName - A name as returned by getWhatsAppTemplateBy in the name variablewabaID - An optional WABA ID to look for the template ID under.channelID - An optional channel ID to specify. If the template can be sent via the channel, it will return the template.List<TemplateResponse> template listUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if template name is not found under the given WABA or cannot be sent under the supplied channel IDIllegalArgumentException - if the provided arguments are not validpublic TemplateResponse fetchWhatsAppTemplateBy(String templateName, String language) throws GeneralException, UnauthorizedException, NotFoundException, IllegalArgumentException
templateName - A name as returned by getWhatsAppTemplateBy in the name variablelanguage - A language code as returned by getWhatsAppTemplateBy in the language variableTemplateResponse templateUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if template name and language are not found under the first waba connected to the requesting user.IllegalArgumentException - if the provided arguments are not validpublic TemplateResponse fetchWhatsAppTemplateBy(String templateName, String language, String wabaID, String channelID) throws GeneralException, UnauthorizedException, NotFoundException, IllegalArgumentException
templateName - A name as returned by getWhatsAppTemplateBy in the name variablelanguage - A language code as returned by getWhatsAppTemplateBy in the language variablewabaID - An optional WABA ID to look for the template ID under.channelID - An optional channel ID to specify. If the template can be sent via the channel, it will return the template.TemplateResponse templateUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if template name and language are not found under the given WABA or cannot be sent under the supplied channel ID.IllegalArgumentException - if the provided arguments are not validpublic void deleteTemplatesBy(String templateName) throws UnauthorizedException, GeneralException, NotFoundException
templateName - A template name which is created on the MessageBird platformUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if template name is not foundpublic ChildAccountCreateResponse createChildAccount(ChildAccountRequest childAccountRequest) throws UnauthorizedException, GeneralException
childAccountRequest - of child account to createUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic ChildAccountResponse updateChildAccount(String name, String id) throws UnauthorizedException, GeneralException
id - of child account to updateUnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic ChildAccountDetailedResponse getChildAccountById(String id) throws UnauthorizedException, GeneralException, NotFoundException
id - of child account to updateUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if id is not foundpublic List<ChildAccountResponse> getChildAccounts(Integer offset, Integer limit) throws UnauthorizedException, GeneralException
UnauthorizedException - if client is unauthorizedGeneralException - general exceptionpublic void deleteChildAccount(String id) throws UnauthorizedException, GeneralException, NotFoundException
id - of child account to deleteUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if id is not foundpublic OutboundSmsPriceResponse getOutboundSmsPrices() throws GeneralException, UnauthorizedException, NotFoundException
UnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if pricing information could not be foundpublic OutboundSmsPriceResponse getOutboundSmsPrices(String smppUsername) throws GeneralException, UnauthorizedException, NotFoundException
smppUsername - the SMPP SystemID provided by MessageBirdUnauthorizedException - if client is unauthorizedGeneralException - general exceptionNotFoundException - if pricing information could not be found for the given SMPP usernameCopyright © 2024. All rights reserved.