Skip to content

elibom/elibom-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Elibom Java API Client

A java client of the Elibom REST API. The full API reference is here.

Getting Started

1. Include the library

Add the dependency to your projects pom.xml file:

<dependency>
  <groupId>com.elibom</groupId>
  <artifactId>elibom-java</artifactId>
  <version>0.2.7</version>
</dependency>

Or download the JAR, its dependencies and include it in your project.

2. Create an ElibomRestClient object passing your credentials:

System.setProperty("jsse.enableSNIExtension", "false"); // if you are using Java 7
ElibomRestClient elibom = new ElibomRestClient("your_email", "your_api_password");

Note: You can find your api password at http://www.elibom.com/api-password (make sure you are logged in).

You are now ready to start calling the API methods!

API methods

Send SMS

String deliveryId = elibom.sendMessage("51965876567, 573002111111", "This is a test");

Schedule SMS

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
long scheduleId = elibom.scheduleMessage("51965876567, 573002111111", "This is a test", sdf.parse("2014-08-24 10:00"));

Show Delivery

Delivery delivery = elibom.getDelivery("<delivery_token>")
System.out.println(delivery);

List Scheduled SMS Messages

List<Schedule> schedules = elibom.getScheduledMessages();
for (Schedule schedule : schedules) {
  System.out.println(schedule);
}

Show Scheduled SMS Message

Schedule schedule = elibom.getScheduledMessage(<schedule_id>)
System.out.println(schedule);

Cancel Scheduled SMS Message

elibom.unschedule(<schedule_id>)

List Users

List<User> users = elibom.getUsers();
for (User user : users) {
  System.out.println(user);
}

Show User

User user = elibom.getUser(<user_id>)
System.out.println(user);

Show Account

Account account = elibom.getAccount();
System.out.println(account);