Docs
Ruby

Ruby

Learn how to create your first sigature request using the DigiSign Ruby SDK.

Prerequisites

To get the most out of this guide, you’ll need to:

Install

Get the DigiSign Ruby SDK.

gem install digisign-ruby-sdk

Authenticate

The DigiSign API requires authentication via an API Key. Learn More.

Call create_session to authenticate. Each session expires every 6 minutes.

def main
  begin
    session = create_session('ds_123456789')
  rescue StandardError => e
    puts e.message
  end
end
 
# Call the main function
main

Transform a template to a Request

The easiest way to create a request is by using the transform method.

def main
  begin
    session = create_session('ds_123456789')
    workspace_id = 'ws_1234567890'
 
    data = {
      'recipients' => [
        {
          'id' => 'tmp-abcdefg123456789', # Must match corresponding alias ID from the selected template
          'name' => 'Jessica Lee',
          'email' => 'jessicalee@example.com'
        }
      ]
    }
 
    session.requests.workspace(workspace_id).transform(data)
  rescue StandardError => e
    puts e.message
  end
end
 
# Call the main function
main

Recipients ID must match a corresponding alias ID from the selected template.

Try it yourself

Was this page helpful?