smspro

This is created to send and recieve sms from https://www.smspro.se

Usage no npm install needed!

<script type="module">
  import smspro from 'https://cdn.skypack.dev/smspro';
</script>

README

Smspro

This is created to send and recieve sms from https://www.smspro.se

Usage:

Send

const SmsPro = require('smspro')

const smsPro = new SmsPro({
  'customerId': '',
  'customerPassword': '',
  'username': '',
  'password': '',
  'endpoint': '',
  'from': ''
})

await smsPro.sendMtSms({ to: ['phoneNumber'], message: 'k-dot is amazing'})

Returns:

{
  datetime: '2018-03-16 15:58:19',
  message: 'The MT SMS request is being processed.',
  code: '0',
  status: '0',
  errorCode: '0',
  customerId: 'kdot',
  mobilectrlId: '9123812831238'
}

Parse incoming the xml-message to JSON:

smsPro.parseIncoming(xml)

Returns:

{
  message: 'Text message from mobile',
  phoneNumber: '+46708651052',
  phoneNumberNormalized: '0708651052'
}

Send flash sms

const SmsPro = require('smspro')

const smsPro = new SmsPro({
  'customerId': '',
  'customerPassword': '',
  'username': '',
  'password': '',
  'endpoint': '',
  'from': ''
})

await smsPro.sendFlashSms({ to: ['phoneNumber'], message: 'k-dot is amazing'})