|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.elibom.client.ElibomRestClient
public class ElibomRestClient
The elibom.com REST API client.
| Constructor Summary | |
|---|---|
ElibomRestClient(String username,
String apiPassword)
Initializes the client with the supplied username and apiPassword. |
|
ElibomRestClient(String username,
String apiPassword,
String host)
Mostly used for testing. |
|
| Method Summary | |
|---|---|
Account |
getAccount()
Query your account info. |
Delivery |
getDelivery(String deliveryId)
Query the delivery with the specified deliveryId. |
Schedule |
getScheduledMessage(long id)
Query the scheduled message with the specified id. |
List<Schedule> |
getScheduledMessages()
Query the scheduled messages. |
User |
getUser(long id)
Query a single account user. |
List<User> |
getUsers()
Query your account users (those who have access to the account). |
long |
scheduleMessage(String to,
String text,
Date scheduleDate)
Schedules an SMS message for the specified scheduleDate to one or more destinations and with the specified
text. |
String |
sendMessage(String to,
String text)
Sends an SMS message to one or more destinations with the specified text. |
void |
unschedule(long id)
Cancels the scheduled message with the specified id. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ElibomRestClient(String username,
String apiPassword)
username and apiPassword.
username - the email you use to access your account at elibom.com.apiPassword - your API password, which can be found in the settings section of your account.
public ElibomRestClient(String username,
String apiPassword,
String host)
username, apiPassword and
host. Mostly used for testing.
username - the email you use to access your account at elibom.com.apiPassword - your API password, which you can find in the settings of your account.host - the host to which the requests are going to be made.| Method Detail |
|---|
public String sendMessage(String to,
String text)
throws HttpServerException,
RuntimeException
text.
to - the destinations (separated by comma) to which you want to send the SMS message.text - the text of the SMS message, max 160 characters.
getDelivery(String) method).
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
public long scheduleMessage(String to,
String text,
Date scheduleDate)
throws HttpServerException,
RuntimeException
scheduleDate to one or more destinations and with the specified
text.
to - the destinations (separated by comma) to which we are going to send the scheduled SMS message.text - the text of the SMS message, max 160 characters.scheduleDate - the date in which the message is going to be sent.
#getSchedule(long) method.
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
public Delivery getDelivery(String deliveryId)
throws HttpServerException,
RuntimeException
deliveryId.
deliveryId -
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
public List<Schedule> getScheduledMessages()
throws HttpServerException,
RuntimeException
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
public Schedule getScheduledMessage(long id)
throws HttpServerException,
RuntimeException
id - the id of the scheduled message to query.
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
public void unschedule(long id)
throws HttpServerException,
RuntimeException
id.
id - the id of the schedule to be canceled.
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
public List<User> getUsers()
throws HttpServerException,
RuntimeException
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
public User getUser(long id)
throws HttpServerException,
RuntimeException
id - the id of the account user to query.
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
public Account getAccount()
throws HttpServerException,
RuntimeException
HttpServerException - if the server responds with a HTTP status code other than 200 OK.
RuntimeException - wraps any other unexpected exception.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||