Giter VIP home page Giter VIP logo

voto-ruby's Introduction

VotoRuby

Build Status

A module for using the VOTO Mobile REST API.

Installation

Add this line to your application's Gemfile:

gem 'voto_ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install voto_ruby

Usage

Read the [https://go.votomobile.org/apidoc/](VOTO Mobile API documentation).

###Authentication All API requests must authenticate by posting an organization’s API Key.

You can request an API Key for a new account by contacting [email protected]. To look up your API Key, visit https://go.votomobile.org/settings#apiSettings

The parameter ‘api_key’ can be included as a parameter with every GET or POST request. HTTPS is used to protect the security of API keys.

The ‘api_key’ can also be posted in the header of the request.

###Client

# Get a with your API Key
client = VotoMobile::REST::Client.new '#{api_key}'

# Subscribers
client.subscribers

# Surveys
client.surveys

# Questions
client.questions(survey_id)

###Pagination

# If pagination is enabled on the endpoint method you are using (in this case, subscribers)...
subscribers = client.subscribers

# Use the next() method to retrieve a new SubscribersList object which contains the next 
# page of records and has next() and previous() methods.
subscribers = subscribers.next

Note: The default page limit is 100 records.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/voto_ruby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

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.