freemobile-sms
💬 A simple free-mobile's sms API wrapper 💬
A simple API and command line tools to send SMS using the Free Mobile 'notification' option.
Prerequisites
This module was developed using Node.js 8.9.X and was not tested with previous versions (even if it may work with previous releases).
How to install
As a project module
npm install -S freemobile-sms
As a global package
npm install -g freemobile-sms
Example
Using the library
freemobile-sms use Promise to make call to the API. Here is an example that send a SMS and display and error if something went wrong:
.send(message, credentials)
.send([message], credentials)
const freemobile = ; freemobile;
Using the built-in command
sms Hello World!
Send a SMS to your mobile phone with the 'Hello World!' text.
sms -s Hello World!
Handle each argument as a single message (send two messages 'Hello' and 'World!').
sms -f my_file.txt
Send the content of the 'my_file.txt' file.
sms -f my_file.txt -e ascii
Same as previous, but use ascii encoding to read the file.
sms -c Hello World!
(Re)configure your credentials before sending the 'Hello World!' message.
Credentials
Setup your credentials using one of the following methods:
-
Run
sms -c
orsms --config
-
Create a
credentials.json
file in the project's directory and fill it using the following pattern:
{ "user": "YOUR_USER_ID", "password": "YOUR_SECRET_KEY"}
NB: If no credentials are set when running the sms
command, the credentials configuration process will be called automatically.
App
Head to this link to get your secret key. 🔑
Disclaimer
freemobile-sms provided by Scotow is for illustrative purposes only which provides customers with programming information regarding the products. This software is supplied "AS IS" without any warranties and support.
I assumes no responsibility or liability for the use of the software, conveys no license or title under any patent, copyright, or mask work right to the product.