OVH Sms Domain Classes

OVH SMS Client - Common classes

Лицензия

Лицензия

Категории

Категории

Doma Данные ORM
Группа

Группа

be.valuya
Идентификатор

Идентификатор

ovh-sms-domain
Последняя версия

Последняя версия

1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

OVH Sms Domain Classes
OVH SMS Client - Common classes
Ссылка на сайт

Ссылка на сайт

https://github.com/Valuya/ovh-sms-client
Система контроля версий

Система контроля версий

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

Скачать ovh-sms-domain

Как подключить последнюю версию

<!-- 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"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

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

Версии библиотеки

Версия
1.1
1.0