movile-messaging 📲
Movile's SMS Messaging API.
Unofficial Node.js wrapper for** Read carefully through Movile Messaging's official documentation (link above) before using this module. It will NOT attempt to validate or sanitize your parameters before sending requests, so make sure you're sending what they are expecting to receive. **
You will need your own UserName
and AuthenticationToken
to make API calls.
Note that most optional parameters are missing in this module, I'm working on it. PR's are welcome as well 😉
Usage example:
const Movile = ;const sms = 'YOUR_USER_NAME' 'YOUR_AUTH_TOKEN'; sms // do something with this data; // your error handling
Methods:
send(destination, messageText)
Send SMS message to a single endpoint.
destination
: Phone number with country code and area code. Example:'5519998765432'
messageText
: The message string to be sent. If it's too long, it will be split into multiple messages.
Example:
sms // do something with this data; // your error handling
Expected response body:
sendBulk(numbers, messageText)
Send the same SMS message to many endpoints at once.
numbers
: Array of phone numbers, just likedestination
in thesend
method.messageText
: The message string to be sent. If it's too long, it will be split into multiple messages.
Example:
sms // do something with this data; // your error handling
Expected response body:
getStatus(id)
Check the delivery status of a single message.
id
: ID of a message, obtained when it is sent.
Example:
sms // do something with this data; // your error handling
Expected response body:
listReceived()
Retrieve messages sent to your LA's (i. e. a client replied to your SMS).
Example:
sms // do something with this data; // your error handling
Expected response body:
searchReceived(start, end)
Search for messages received in a time interval (between start
and end
, as one would expect).
start
: ISO8601-formatted string. Defaults to 5 days ago from current date.end
: ISO8601-formatted string. Defaults to current date.
Example:
sms
Expected response body: same format as listReceived()
- Note that phone numbers from
OI
andSercomtel
carriers will not returnDELIVERED_SUCCESS
status even if the SMS was successfully received. - Data is only retained in Movile's end for a few days, so you may want to store this data somewhere else.
Special thanks to @mCodex