🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

octopush

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

octopush

Octopush API wrapper

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Octopush API library for Node.js

Build Status

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

Installation via npm

npm install octopush

Usage

Config file (config.js)

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_PREMIUM,
    sms_mode: octopush.constants.INSTANTANE,
    sms_sender: 'Octopush'
};

Balance check

var octopush = require('octopush');
var config = require('./config.js');

var sms = new octopush.SMS(config.user_login, config.api_key);

sms.get_balance(function(e, r){
    console.log(r.octopush.balance);
});

SMS sending

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_mode(config.sms_mode);
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.

Requirements

  • API key, register at octopush.com to get one
  • Node.js

Documentation

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.

FAQs

Package last updated on 05 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts