A Node.js library for Octopush API.
Octopush offers a solution that was built in-house as a hosted service (SaaS, Software as a Service and an API) to allow marketing departments of major groups, advertising agencies and IT companies to enjoy an infrastructure that supports sending SMS messages to more than 200 countries.
Installation via npm
npm install octopush
var octopush = require('octopush');
module.exports = {
user_login: '*******@*******',
api_key: '****************',
sms_recipients: ['+33600000000'],
sms_text: 'test text ' + (new Date()).getYear() + '-' + ((new Date()).getMonth() + 1) + '-' + (new Date()).getDay(),
sms_type: octopush.constants.SMS_WORLD,
sms_sender: 'onesender'
};
var octopush = require('octopush');
var config = require('./config.js');
var sms = new octopush.SMS(config.user_login, config.api_key);
sms.get_credit(function(e, r){
console.log(r.octopush.credit);
});
var octopush = require('octopush');
var config = require('./config.js');
var sms = new octopush.SMS(config.user_login, config.api_key);
sms.set_sms_text(config.sms_text);
sms.set_sms_recipients(config.sms_recipients);
sms.set_sms_type(config.sms_type);
sms.set_sms_sender(config.sms_sender);
sms.set_sms_request_id(sms.uniqid());
sms.send(function(e, r){
if(e) {
console.log('Error:', r);
} else {
console.log('Success:', JSON.stringify(r));
}
});
More examples can be found in Simple Examples and Advanced Examples.
- API key, register at octopush.com to get one
- Node.js
This library is completely documented using JSDoc and will show autocompletions in all editors that supports it. Alternatively you can build HTML version of documentation via jsdoc tool.
API documentation available on Octopush API documentation portal.