Code Monkey home page Code Monkey logo

sms_ru's Introduction

sms_ru

Nodejs модуль для работы с API сервиса sms.ru

Официальная документация по работе с API – http://sms.ru/?panel=api

Установка

npm install sms_ru

Использование

Подключение:

var SMSru = require('sms_ru');

Авторизация (с помощью api_id):

var sms = new SMSru(api_id);

Авторизация (с помощью логина и пароля):

var sms = new SMSru(login, password);

Отправка SMS:

sms.sms_send({
  to: '79112223344',
  text: 'Текст SMS'
}, function(e){
  console.log(e.description);
});


sms.sms_send({
  to: '79112223344,79115556677,79115552255',
  text: 'Текст SMS',
  from: 'Имя отправителя',
  time: new Date()/1000+60,
  translit: false,
  test: false,
  partner_id: partner_id
}, function(e){
  console.log(e.description);
});


sms.sms_send({
  multi: [
    ['79112223344', 'Текст СМС'],
    ['79115556677', 'Текст СМС'],
    ['79115552255', 'Текст СМС']
  ], function(e){
    console.log(e.description);
});

Статус SMS:

sms.sms_status('SMS id', callback);

Стоимость SMS:

sms.sms_cost({
  to: '79112223344',
  text: 'Текст SMS'
}, callback);

Баланс:

sms.my_balance(function(e){
  console.log(e.balance);
})

Дневной лимит:

sms.my_limit(function(e){
  console.log(e.current+' / '+e.total);
})

Отправители:

sms.my_senders(function(e){
  console.log(e.senders);
})

Добавить номер в стоплист:

sms.stoplist_add({
  phone:'79112223344',
  text:'Примечание'
}, callback)

Удалить номер из стоп-листа:

sms.stoplist_del({
  phone:'79112223344',
}, callback)

Получить номера стоплиста:

sms.stoplist_get(function(e){
  console.log(e.stoplist);
})

Автор

Максим Бородин, e-mail: [email protected]

sms_ru's People

Contributors

borodincp avatar

Watchers

Andrey Lukyanov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.