Git Product home page Git Product logo

verticalresponse's Introduction

VerticalResponse

Gem used to make it easier to connect to VerticalResponse.com's API

Based on https://github.com/VerticalResponse/v1wrappers/

90% of the code is the same as the original wrappers. The point here was to put the official VerticalResponse wrappers in a gem, and to allow calling oauth_clients by object instances, identified by access tokens.

New Functionality

Allows instantiating oauth clients by access_token, to access the VerticalResponse API in an object-oriented fashion. The calls are object-oriented in the sense that you can instantate a client with its access_token. This is not possible with the original wrappers.

client = VerticalResponse::API::OAuth.new access_token

# Get all lists
client.lists

# Get a specific list
client.find_list("<id>")

# Get contacts in a specific list
client.find_list("<id>").contacts

# Create multiple contacts in a specific list
client.find_list("<id>").create_contacts([{
    email: "[email protected]",
    first_name: "some first name",
    last_name: "some last name",
    custom: {
      field: "some custom field"
    }
  },
  {
    email: "[email protected]",
    first_name: "another first name",
    last_name: "another last name",
    custom: {
      field: "another custom field"
    }
  }
])

# Get all contacts
client.contacts

# Get all custom fields
client.custom_fields

And a few other calls as well. Not all wrapper methods are supported, but you're more than welcome to implement them yourself and submit pull requests.

Requirements

Ruby 1.9+ (compatible with Ruby 2.1.1)

HTTParty gem

Note: I only tested these requirements as much as I needed to (not for all functionalities), so you might encounter bugs here and there. But, if the community can make an effort to build this, I'm sure you can make an effort to test that this works for you as well, and even submit fixes wherever possible.

Contribute

The features of this gem were built as needed, and it is pretty limited. Contributions are more than welcome!

verticalresponse's People

Contributors

kosmin avatar

Watchers

James Cloos 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.