Skip to content
No description or website provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status

@cmdotcom/text-sdk: A helper library to send messages.

Want to send messages in your Java application? Then you are at the right place. If you want to get all the functionalities, go to: API Docs


Add the GSon dependency to your project:

Build Status Download our Jar file and add it to your project.

Instantiate the client

Use your productToken which authorizes you on the CM platform. Get yours on

MessagingClient client = new MessagingClient("YourproductToken");

Send a message

By calling SendTextMessage and providing message text, sender name, recipient phone number(s).

   MessagingClient client = new MessagingClient("YourProductToken");
      client.sendTextMessage("Message Text", "TestSender", new String[] {"00316012345678"});

Sending a rich message

By using the MessageBuilder it is possible to create images with media for channels such as WhatsApp and Viber

 MessagingClient client = new MessagingClient("YourProductToken");

 MessageBuilder builder = new MessageBuilder("Message Text", "TestSender", new String[] {"00316012345678"});

 builder.WithAllowedChannels(new Channel[] {Channel.Viber});

    builder.WithRichMessage(new MediaMessage(

       Message message = builder.Build();


Get the result

Sending an message returns the response body

	"details": "Created 1 message(s)",
	"errorCode": 0,
	"messages": [{
		"to": "00316012345678",
		"status": "Accepted",
		"reference": null,
		"parts": 1,
		"messageDetails": null,
		"messageErrorCode": 0
You can’t perform that action at this time.