Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 2.6 KB

README.md

File metadata and controls

48 lines (37 loc) · 2.6 KB

smsgw-client-java

Build Status Coverage Status Maven Central Codacy coverage

This Java library contains some convenience APIs that lets you connect to the Intelecom SMS Gateway. Alternatively, you could integrate directly with one of the interfaces yourself.

The library consist of two parts: One client builder and builders to create a request.

The client implementation uses the JAX-RS 2.0 Client interface. Therefore, you need to run it in a JAX-RS 2.0 J2EE compliant container or provide a JAX-RS 2.0 implementation yourself (e.g. Jersey).

Installation

Maven

<dependency>
	<groupId>com.intele.chimera</groupId>
	<artifactId>smsgw-client-java</artifactId>
	<version>1.0.0</version>
</dependency>

Gradle

compile "com.intele.chimera:smsgw-client-java:1.0.0"

Examples

Standalone

try(GatewayClient gatewayClient = new GatewayClientBuilder().build()) 
	GatewayRequest gatewayRequest = new GatewayRequest.Builder(100, "username", "password").build();
	gatewayRequest.addMessage(
			new Sms.Builder("+4741000000", "Test message").withPrice(0).build());
	Response response = gatewayClient.send(gatewayRequest);

	System.out.println(response.getMessageStatus().get(0).getStatusCode());
	System.out.println(response.getMessageStatus().get(0).getStatusMessage());
	System.out.println(response.getMessageStatus().get(0).getMessageId());
} catch(Exception e) {
	e.printStackTrace();
}