OVH Sms Domain Classes

OVH SMS Client - Common classes

License

License

Categories

Categories

Doma Data ORM
GroupId

GroupId

be.valuya
ArtifactId

ArtifactId

ovh-sms-domain
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

jar
Description

Description

OVH Sms Domain Classes
OVH SMS Client - Common classes
Project URL

Project URL

https://github.com/Valuya/ovh-sms-client
Source Code Management

Source Code Management

https://github.com/Valuya/ovh-sms-client

Download ovh-sms-domain

How to add to project

<!-- https://jarcasting.com/artifacts/be.valuya/ovh-sms-domain/ -->
<dependency>
    <groupId>be.valuya</groupId>
    <artifactId>ovh-sms-domain</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/be.valuya/ovh-sms-domain/
implementation 'be.valuya:ovh-sms-domain:1.1'
// https://jarcasting.com/artifacts/be.valuya/ovh-sms-domain/
implementation ("be.valuya:ovh-sms-domain:1.1")
'be.valuya:ovh-sms-domain:jar:1.1'
<dependency org="be.valuya" name="ovh-sms-domain" rev="1.1">
  <artifact name="ovh-sms-domain" type="jar" />
</dependency>
@Grapes(
@Grab(group='be.valuya', module='ovh-sms-domain', version='1.1')
)
libraryDependencies += "be.valuya" % "ovh-sms-domain" % "1.1"
[be.valuya/ovh-sms-domain "1.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

ovh-sms-client

OVH sms client library in Java 8. Could be adapted to Java 7 without too much effort.

This library allows you to send an SMS using OVH REST api.

It uses JAX-RS 2 and tries to be portable and as clean as possible.

It just uses POJOs and standard JAX-RS to communicate with OVH. A ClientRequestFilter is used to sign requests according to OVH strange, useless signing requirements.

Contrary to other samples found on the web, including on OVH web site, it works with UTF-8 characters.

Setup and testing

Create an API key and stuff there if you don't have them. You should grant GET role on /sms and GET+POST on /sms/*/jobs (no slashes at the end contrary to what OVH guide says, or it will fail with HTTP status 403!).

You can paste the generated app key/secret, consumer key and service name in SmsClientTest and remove @Ignore to test it.

Send some SMS

  SmsMessage smsMessage = new SmsMessage();
  smsMessage.setSender("valuya.be");
  smsMessage.setMessage("¿Qué pasa tronco?");
  smsMessage.setReceivers(Arrays.asList("+32498707213"));
  smsMessage.setSmsCoding(SmsCoding.EIGHT_BIT);

  // get some SmsClient
  // you'll probably want to get those params from your configuration
  SmsClient smsClient = new SmsClient(appSecret, appKey, consumerKey);
  // send it
  SmsJob smsJob = smsClient.sendSms(serviceName, smsMessage);

  List<String> invalidReceivers = smsJob.getInvalidReceivers(); // should be empty if everything is ok
be.valuya

Valuya sprl

Versions

Version
1.1
1.0