![smsorange](https://img.freepik.com/vecteurs-libre/nouvelle-illustration-concept-message_114360-636.jpg)
smsorange
A Node.js module for send sms with bundle Orange.
The Orange api Sms allows you to send SMS in the whole area of West Africa, Central Africa and France.
Orange sms api is entirely based on Bearer token authentication. This token is sent by Orange and usually expires in 1 hour (3600 sec).
So you have to watch the expiration period of the token before doing anything.
The smsorange package manages it for you and offers you a wide range of nested methods allowing you to concentrate on your code logic.
Installation
$ npm i smsorange
Initialize
"use strict"
import { SmsOrange } from 'smsorange'
const smsWrapper = new SmsOrange({authorization_header:"<Your Authorization header>",
yourNumber: "<Your Number>",
senderName: "<Sender Name or Service Name>"
)
How to send Message at one address (plugin generate accessToken auto if it is expired)
const response = await smsWrapper.sendSms({numberTo: 'numberOfReceiver', message:'Your message. 👍'});
How to send Message at many Address (plugin generate accessToken auto if it is expired)
const response = await smsWrapper.sendSms({numberTo: ['numberOfReceiver','numberOfReceiver','numberOfReceiver',...], message:'Your message. 👍'});
How get Balance
From your application, or inside your own administration zone, you may have the need to check and display how many SMS you can still send to your customers.
const balance = await smsWrapper.getBalanceAvailable();
How get Statistics of messages already sent
From your application or inside your own administration zone, you may need to track how many SMS has been sent per application and/or country. For this usage.
const balance = await smsWrapper.getStatisticsSmsSent();
How get purchase history of payement bundle
Last but not least for the account management API, you may also need to track all the purchased orders you did with your account.
const balance = await smsWrapper.getPurchaseOrder();
How to contribute
Have an idea? Found a bug? See how to contribute.
License
See the LICENSE file.
Autor
Rochel Ryu | Dev JS/TS Dart & Kotlin
Which uses this package
![](https://www.shouz.network/static/media/logo-7.e73ba927.png)