public class TextMessagingService
extends java.lang.Object
Constructor and Description |
---|
TextMessagingService() |
Modifier and Type | Method and Description |
---|---|
static javax.ws.rs.core.Response |
addContactsToGroup(ContactGroup group)
Add new contacts to a group of contacts.
|
static javax.ws.rs.core.Response |
addNewGroup(ContactGroup group)
Adds a new contact group onto your account as one would add from the SMSJuice web account.
|
static javax.ws.rs.core.Response |
addNewTemplate(MessageTemplate template)
Adds a new canned-message/template for sending to the recipient.
|
static javax.ws.rs.core.Response |
addRecipientRateLimitRule(RecipientLimitRule rule)
Sets a rate limit rule for recipients.
|
static ContactGroup |
createContactGroupInstance(java.lang.String key,
java.lang.String secret,
java.lang.String groupName)
Creates an instance of a group in which you can add contacts
|
static Message |
createMessageInstance(java.lang.String key,
java.lang.String secret,
RecipientType recipientType,
int templateId)
Creates an instance of a message object which stores all aspects of the message (from, to-list, receiptwanted, encoding, sending schedule date, expiry date of the message, udhi )
|
static Message |
createMessageInstance(java.lang.String key,
java.lang.String secret,
RecipientType recipientType,
java.lang.String message)
Creates an instance of a message object which stores all aspects of the message (from, to-list, receiptwanted, message-content, encoding, sending schedule date, expiry date of the message, udhi )
|
static Message |
createMessageInstance(java.lang.String key,
java.lang.String secret,
java.lang.String recipientType)
Deprecated.
|
static javax.ws.rs.core.Response |
deleteContactFromGroup(java.lang.String key,
java.lang.String secret,
java.lang.String groupName,
java.lang.String contactNumber)
Deletes a contact from a group.
|
static javax.ws.rs.core.Response |
deleteGroup(java.lang.String key,
java.lang.String secret,
java.lang.String groupName)
Deletes a group from your SMSJuice account
|
static javax.ws.rs.core.Response |
deleteRecipientRateLimitRule(java.lang.String key,
java.lang.String secret)
Delete/Reomove recipient rate limit rules
|
static javax.ws.rs.core.Response |
getAllGroupContacts(java.lang.String key,
java.lang.String secret,
java.lang.String groupName)
Gets all contacts in a group
|
static javax.ws.rs.core.Response |
getAllGroups(java.lang.String key,
java.lang.String secret)
Get a list of all groups from your SMSJuice account
|
static javax.ws.rs.core.Response |
getBalance(java.lang.String key,
java.lang.String secret)
Gets the balance on your account
|
static javax.ws.rs.core.Response |
getCredit(java.lang.String key,
java.lang.String secret)
Gets the credits left on your account
|
static javax.ws.rs.core.Response |
getMessageReport(java.lang.String key,
java.lang.String secret,
java.lang.String messageId)
Returns the message status of a message sent.
|
static javax.ws.rs.core.Response |
getTemplate(java.lang.String key,
java.lang.String secret,
java.lang.String templateId)
Get one template stored on your account by its Id
|
static javax.ws.rs.core.Response |
getTemplatesList(java.lang.String key,
java.lang.String secret)
Get a list of all templates stored for your account
|
static javax.ws.rs.core.Response |
sendMessage(Message message)
Sends a message to the server API to be sent to all the recipients listed in the message object
|
public static Message createMessageInstance(java.lang.String key, java.lang.String secret, java.lang.String recipientType) throws MessageException, RecipientTypeException
key
- found from your account settings pagesecret
- found from your account settings pageMessageException
RecipientTypeException
public static Message createMessageInstance(java.lang.String key, java.lang.String secret, RecipientType recipientType, int templateId) throws MessageException
key
- found from your account settings pagesecret
- found from your account settings pagerecipientType
- Type of recipients to which the message will be sent. Groups or numberstemplateId
- the template ID of the message (stored on your SMSJuice account) to be sent as the message content to the recipientsMessageException
RecipientTypeException
public static Message createMessageInstance(java.lang.String key, java.lang.String secret, RecipientType recipientType, java.lang.String message) throws MessageException
key
- found from your account settings pagesecret
- found from your account settings pagerecipientType
- Type of recipients to which the message will be sent. Groups or numbersmessage
- The message content to be sentMessageException
RecipientTypeException
public static ContactGroup createContactGroupInstance(java.lang.String key, java.lang.String secret, java.lang.String groupName) throws ContactException
key
- found from your account settings pagesecret
- found from your account settings pagegroupName
- The name that will be given to the groupContactException
public static javax.ws.rs.core.Response sendMessage(Message message) throws java.io.IOException
message
- Message object to sendMessageException
java.io.IOException
public static javax.ws.rs.core.Response getMessageReport(java.lang.String key, java.lang.String secret, java.lang.String messageId) throws java.io.IOException
key
- found from your account settings pagesecret
- found from your account settings pagemessageId
- ID of the message that you want to query to see its delivery status or report.java.io.IOException
public static javax.ws.rs.core.Response getBalance(java.lang.String key, java.lang.String secret) throws java.io.IOException
key
- found from your account settings pagesecret
- found from your account settings pagejava.io.IOException
public static javax.ws.rs.core.Response getCredit(java.lang.String key, java.lang.String secret) throws java.io.IOException
key
- found from your account settings pagesecret
- found from your account settings pagejava.io.IOException
public static javax.ws.rs.core.Response addNewGroup(ContactGroup group) throws ContactException, java.io.IOException
group
- the ContactGroup to add to your accountContactException
java.io.IOException
public static javax.ws.rs.core.Response addContactsToGroup(ContactGroup group) throws ContactException, java.io.IOException
group
- groups to add contacts toContactException
java.io.IOException
public static javax.ws.rs.core.Response getAllGroups(java.lang.String key, java.lang.String secret) throws java.io.IOException
key
- found from your account settings pagesecret
- found from your account settings pagejava.io.IOException
public static javax.ws.rs.core.Response getAllGroupContacts(java.lang.String key, java.lang.String secret, java.lang.String groupName) throws java.io.IOException
key
- found from your account settings pagesecret
- found from your account settings pagegroupName
- the group name whose contacts you want to getjava.io.IOException
public static javax.ws.rs.core.Response deleteGroup(java.lang.String key, java.lang.String secret, java.lang.String groupName)
key
- found from your account settings pagesecret
- found from your account settings pagegroupName
- the group name you wish to deletepublic static javax.ws.rs.core.Response deleteContactFromGroup(java.lang.String key, java.lang.String secret, java.lang.String groupName, java.lang.String contactNumber)
key
- found from your account settings pagesecret
- found from your account settings pagegroupName
- the group name you wish to delete the contact fromcontactNumber
- the number you wish to remove from the grouppublic static javax.ws.rs.core.Response addNewTemplate(MessageTemplate template) throws TemplateException, java.io.IOException
template
- the template with the message to addContactException
java.io.IOException
TemplateException
public static javax.ws.rs.core.Response getTemplatesList(java.lang.String key, java.lang.String secret)
key
- found from your account settings pagesecret
- found from your account settings pagepublic static javax.ws.rs.core.Response getTemplate(java.lang.String key, java.lang.String secret, java.lang.String templateId)
key
- found from your account settings pagesecret
- found from your account settings pagetemplateId
- ID of the remplate you want to getpublic static javax.ws.rs.core.Response addRecipientRateLimitRule(RecipientLimitRule rule) throws LimitRuleException, java.io.IOException
rule
- Rule object with the rate limit rulesLimitRuleException
- Thrown when either of the set rules is less than the numeric value of 1java.io.IOException
public static javax.ws.rs.core.Response deleteRecipientRateLimitRule(java.lang.String key, java.lang.String secret)
key
- found from your account settings pagesecret
- found from your account settings page