Skip to content

Latest commit

 

History

History
60 lines (51 loc) · 1.75 KB

README.md

File metadata and controls

60 lines (51 loc) · 1.75 KB

nimbasms-java

A Java module for communicating with Nimba SMS API.

Usage

First, instantiate the client using your API key:

NimbaSmsClient client = new NimbaSmsClient("ACCOUNT_SID", "AUTH_TOKEN")

Accounts

Retrieve the account information using the getAccount() method:

AccountResponse accountResponse = client.getAccount().get();
System.out.println(accountResponse);

Sender Names

Retrieve the sender names using the getSenderName() method:

RootResult<SenderNameResponse> senderNameResponse = client.getSenderName().list();
System.out.println(senderNameResponse);

You can also retrieve the last 10 sender names by passing in the limit and offset:

RootResult<SenderNameResponse> last10SenderNameResponse = client.getSenderName().list(10, 1);
System.out.println(last10SenderNameResponse);

Contacts

This code retrieves a list of all contacts.

RootResult<ContactResponse> contacts = client.getContact().list();
System.out.println(contacts);

You can also retrieve the last 10 contacts by passing in the limit and offset:

RootResult<ContactResponse> last10contacts = client.getContact().list(10, 1);
System.out.println(last10contacts);

Create Contact. This contact will be added to the default contact list:

ContactResponse defaultContactResponse = client.getContact().create("+224XXXXXXXXX", null, null);
System.out.println(defaultContactResponse)

Groups

This code retrieves a list of all groups.

RootResult<GroupResponse> groups = client.getGroup().list();
System.out.println(groups);

You can also retrieve the last 10 Group by passing in the limit and offset:

RootResult<GroupResponse> last10groups = client.getGroup().list(10, 1);
System.out.println(last10groups);