Giter Site home page Giter Site logo

hellosign-ruby-sdk's Introduction

HelloSign Ruby SDK

In addition to this readme, checkout our quickstart guide here: https://www.hellosign.com/api/gettingStarted#QuickStart

Installation

Add this line to your application's Gemfile:

gem 'hellosign-ruby-sdk'

And then execute:

$ bundle

Configuration

Create a config block. At a minimum you'll want to set your API Key but depending on your usage you'll possibly want to set your app's Client ID and Client Secret. In Rails you can place it in config/initializers/hello_sign.rb

require 'hello_sign'
HelloSign.configure do |config|
  config.api_key = 'api_key'
  # You can use email_address and password instead of api_key. But api_key is recommended
  # If api_key, email_address and password are all present, api_key will be used
  # config.email_address = 'email_address'
  # config.password = 'password'
end

##Usage When you have configured your app like above, you can start using it:

# get your account
my_account = HelloSign.get_account

# get your signature requests
my_signature_requests = HelloSign.get_signature_requests

# view a specific signature request
signature_request = HelloSign.get_signature_request :signature_request_id => '42383e7327eda33f4b8b91217cbe95408cc1285f'

If you need to authenticate for multiple users and you want a separated client for them, you can run:

client2 = HelloSign::Client.new :api_key => 'your_user_api_key'
user_account = client2.get_account

Specifying files

When using request endpoints that send files, such as a signature request, you can specify files either as

  1. A string representing the path
  2. A Ruby File Object (File.open, then assign to a variable)
  3. A Rails ActionDispatch::Http::UploadedFile

##Testing

Testing relies on built in hard-coded fixtures. You can run the tests without affecting your actual account data. To do so from the root of your project run rake spec.

Additional notes

Warnings

Any warnings returned from the API can be accessed by using the 'warnings' accessor on a returned object or list:

my_signature_requests = client.get_signature_requests
puts my_signature_requests.warnings

and will give output of warnings in the following format (as an array of hashes):

[
    [0] {
         "warning_msg" => "Parameter hodor was ignored. Hodor.",
        "warning_name" => "parameter_ignored"
    },
    [1] {
         "warning_msg" => "Email address [email protected] is unconfirmed. Please pledge your allegiance to the queen first.",
        "warning_name" => "unconfirmed"
    }
]

Local callbacks

We do not allow app callbacks (event or OAuth) to be set to localhost. However it is still possible to test callbacks against a local server. Tunneling services such as ngrok (http://ngrok.com) can help you set this up.

License

The MIT License (MIT)

Copyright (C) 2014 hellosign.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

hellosign-ruby-sdk's People

Contributors

asolberg avatar renderf0x avatar angelafield avatar torbjon avatar volodymyr-mykhailyk avatar bhspitmonkey avatar tyrbo avatar manuelmeurer avatar barelyknown avatar hellofaxsteve avatar jon-eckstein avatar skiva avatar reedloden avatar nolman avatar maxime-d avatar freddyrangel avatar desmondw avatar daveriess avatar andrewhubbs avatar

Watchers

Mark Wilson avatar 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.