public class TextMessagingService
extends java.lang.Object
Constructor and Description |
---|
TextMessagingService() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addContactsToGroup(ContactGroup group)
Add new contacts to a group of contacts.
|
static java.lang.String |
addNewGroup(ContactGroup group)
Adds a new contact group onto your account as one would add from the SMSJuice web account.
|
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,
java.lang.String recipientType)
Creates an instance of a message object which stores all aspects of the message (from, to-list, receiptwanted, message-payload,, encoding, sending schedule date, expiry date of the message, udhi )
|
static java.lang.String |
deleteContactFromGroup(java.lang.String key,
java.lang.String secret,
java.lang.String groupName,
java.lang.String contactNumber)
Deletes a contact from a group.
|
static java.lang.String |
deleteGroup(java.lang.String key,
java.lang.String secret,
java.lang.String groupName)
Deletes a group from your SMSJuice account
|
static java.lang.String |
getAllGroupContacts(java.lang.String key,
java.lang.String secret,
java.lang.String groupName)
Gets all contacts in a group
|
static java.lang.String |
getAllGroups(java.lang.String key,
java.lang.String secret)
Get a list of all groups from your SMSJuice account
|
static java.lang.String |
getBalance(java.lang.String key,
java.lang.String secret)
Gets the balance on your account
|
static java.lang.String |
getCredit(java.lang.String key,
java.lang.String secret)
Gets the credits left on your account
|
static java.lang.String |
getMessageReport(java.lang.String key,
java.lang.String secret,
java.lang.String messageId)
Returns the message status of a message sent.
|
static java.lang.String |
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 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 java.lang.String sendMessage(Message message) throws MessageException, java.io.IOException
message
- Message object to sendMessageException
java.io.IOException
public static java.lang.String 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 java.lang.String 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 java.lang.String 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 java.lang.String addNewGroup(ContactGroup group) throws ContactException, java.io.IOException
group
- the ContactGroup to add to your accountContactException
java.io.IOException
public static java.lang.String addContactsToGroup(ContactGroup group) throws ContactException, java.io.IOException
group
- groups to add contacts toContactException
java.io.IOException
public static java.lang.String 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 java.lang.String 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 java.lang.String 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 java.lang.String 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 group