Giter Site home page Giter Site logo

sendout's Introduction

Sendout

A ruby gem createb by SmartTechys for the SendOut API that allows your application to send text messages (Angolan and International).

ATTENTION

  • API Version 1 - Gem sendout v0.1.1
  • API Version 2 - Gem sendout v0.1.2

Installation

Add this line to your application's Gemfile:

gem 'sendout'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sendout

Setup

  • Make sure you've registed at SendOut and have produced your token(api_token) and id(your registered phone number).
  • Setup your environments variables
SO_API_ID=244911222333
SO_API_TOKEN=your_api_token_obtained_from_control_panel_at_sendout

Usage

At the moment there's only two sendOut endpoints in production:

  • Check your balance
  • Send one or bulk message

Check your balance

Sendout.check_balance

# It will return a json

{
  "cliente": "2449XXXXXXXX"
   "saldo": "512"
   "enviadas": "203"
   "contactos": "2"
   "campanhas": "1"
}

Send one or bulk message - Production Environment

Sendout.send_sms(num, false, msg)

# The num has to be an array the debug a boolean, and the msg an string. This method will return an array of one or more JSON objects.

Response:

[
    {
        "id":"0800000018E1C4DA",
        "de":"2449XXXXXXX5",
        "para":"2449XXXXXXX0",
        "remetente":"SENDOUT",
        "caracteres":"24",
        "quantidade":"1",
        "data":"07-01-2017 18:59:37",
        "rede":"00000",
        "enviado":true,
        "estado":"Entregue"
    }
]

Send one or bulk message - Test Environment

You need to add a boolean value true to send as test; if false will send it to production

Sendout.send_sms(num, true, msg)

# The num has to be an array and the msg an string. This method will return an array of one or more JSON objects

Help and Docs

Development

  • You can fork it
  • bundle
  • bundle rake exec
  • Make your feature addition or fix a bug
  • Do not mess with the rakefile version or history (do not submit version bump PLEASE or put it in a different commit so we can ignore it when pull)
  • Send us the pull request

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/smaziano/sendout. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

sendout's People

Contributors

smaziano avatar cabanga avatar

Stargazers

Aristoteles Lopes avatar  avatar José Cage  avatar Firmino Changani avatar

Watchers

James Cloos avatar  avatar  avatar

sendout's Issues

Security - Rake Update (CVE-2020-8130)

Vulnerable versions: <= 12.3.2
Patched version: 12.3.3
There is an OS command injection vulnerability in Ruby Rake before 12.3.3 in Rake::FileList when supplying a filename that begins with the pipe character |.

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.