Skip to content

texel/docusign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docusign

www.docusign.com www.github.com/texel/docusign

Description

A library for communicating with the Docusign API via SOAP.

Making An API Call

connection = Docusign::Base.login(
  :user_name    => 'your_user_name',
  :password     => 'your_password',
  :endpoint_url => 'http://demo.docusign.net/API/3.0'
)

connection.request_status :envelope_id => '12345'

Install

  1. $ gem update –system (this is only necessary if you don’t have rubygems 1.3.6 or newer)

  2. $ gem install docusign

AutoCamelize

The Docusign gem supports calling methods using both camelCase and snake_case. Methods in snake_case that don’t exist on a Docusign module class or instance are automatically aliased to their camelCase equivalent, if one exists. Hence, the following two examples are functionally identical:

connection.request_status :envelopeID => '12345'
connection.requestStatus :envelopeID => '12345'

Builder syntax

To ease common tasks, some builder methods are included. For example, you can generate tabs for a document for a particular recipient from the document itself:

recipient = Docusign::Recipient.new # You may want to set some attributes of the recipient as well.
document  = Docusign::Document.new

tabs = document.tabs recipient do |d|
  d.tab :name => 'email', :value => email, :page => 1, :x => 190, :y => 186
  d.tab :name => 'phone', :value => phone, :anchor => {:string => 'Phone:',  :x_offset => 200, :y_offset => -2}
  d.tab :type => Docusign::TabTypeCode::FullName, :page => 1, :x => 190, :y => 118
end

These tabs will be pre-populated with both the document’s and recipient’s id. Note that passing in a recipient to the builder is optional- you can still specify or override the recipient for an individual tab:

tabs = document.tabs do |d|
  d.tab :recipient => signer_1, :name => 'email', :value => email, :page => 1, :x => 190, :y => 186
  d.tab :recipient => signer_2, :name => 'email', :value => email, :page => 1, :x => 190, :y => 186
end

You can also use block syntax for the tabs themselves:

tabs = document.tabs recipient do |d|
  d.tab do |t|
    t.name = 'phone'
    t.anchor do |a|
      a.string = 'Phone'
      a.x_offset = 200
    end
  end
end

License

Copyright © DocuSign, Inc. All rights reserved.

This source code is intended only as a supplement to DocuSign SDK and/or on-line documentation.

This sample is designed to demonstrate DocuSign features and is not intended for production use. Code and policy for a production application must be developed to meet the specific data and security requirements of the application.

THIS CODE AND INFORMATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

About

Docusign gem for Ruby

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages