Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.zensend:zensend

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.zensend:zensend

API for sending SMS messages or performing HLR lookups via ZenSend

  • 0.0.3
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Build Status

Installation

The library is distributed via Maven io.zensend::zensend

Examples

Create an instance of the client

Client client = new Client("YOUR-API-KEY");

Sending SMS

To send an SMS, you must specify the originator, body and numbers:

Message message = new Message();
message.originator = "orig";
message.body = "message body";
message.numbers = new String[]{"447777777777", "448888888888"};

SmsResult smsResult = client.sendSms(message);

System.out.println(
    smsResult.txGuid + ":" +
    smsResult.numbers + ":" +
    smsResult.smsParts + ":" +
    smsResult.encoding + ":" +
    smsResult.costInPence + ":" +
    smsResult.newBalanceInPence
);

You can also specify the following optional params:

Message message = new Message();
message.originator = "orig";
message.body = "message body";
message.numbers = new String[]{"447777777777", "448888888888"};
message.originatorType = Message.OriginatorType.ALPHA; // either ALPHA or MSISDN
message.timeToLiveInMinutes = 100;
message.smsEncoding = Message.SmsEncoding.GSM; // either GSM or UCS2

SmsResult smsResult = client.sendSms(message);

System.out.println(
    smsResult.txGuid + ":" +
    smsResult.numbers + ":" +
    smsResult.smsParts + ":" +
    smsResult.encoding + ":" +
    smsResult.costInPence + ":" +
    smsResult.newBalanceInPence
);

Checking your balance

This will return your current balance:

BigDecimal balance = client.checkBalance();

System.out.println(balance);

Listing prices

This will return a HashMap with all our prices by country code:

HashMap<String, BigDecimal> prices = client.getPrices();

System.out.println(prices);

Operator Lookup

This allows you to lookup the operator of a given MSISDN

OperatorLookupResult opLookup = client.lookupOperator("447777777777");

System.out.println(
    opLookup.mcc + ":" +
    opLookup.mnc + ":" +
    opLookup.operator + ":" +
    opLookup.costInPence + ":" +
    opLookup.newBalanceInPence
);

Release

mvn release:clean release:prepare
mvn release:perform -P release-profile

mvn deploy -P release-profile

FAQs

Package last updated on 15 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc