Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 786 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 786 Bytes

codecov

sms019

A json wrapper API for 019 mobile xml API

Usage

First you need to create and save a token. You can do it by manually call generateNewToken function with your username and password. For example:

const SMS = require('019sms');

SMS.generateNewToken('<username>', '<password>', '<optional sub username>')
    .then(console.log);

Save the token as an environment variable or in config file and use it on each request.

To send a message:

const sender = new SMS(process.env.SMS_TOKEN, '<default source>', '<default username>');

sender({destination: '0541234567', message: 'This is a test message'})
    .then(console.log);