Skip to content

Instantly share code, notes, and snippets.

@gmhawash
Created February 26, 2014 18:04
Show Gist options
  • Save gmhawash/9234892 to your computer and use it in GitHub Desktop.
Save gmhawash/9234892 to your computer and use it in GitHub Desktop.
Docusign create document
require 'bundler'
Bundler.require
DocusignRest.configure do |config|
config.username = '[email protected]'
config.password = '********'
config.integrator_key = 'RFXX-5e8080a0-88d3-4c41-94b6-**********'
config.endpoint = 'https://demo.docusign.net/restapi'
config.api_version = 'v2'
end
client = DocusignRest::Client.new
puts client.get_account_id
response = client.create_envelope_from_document(
email: {
subject: 'Sign me please',
body: 'This is the email body from docusign.'
},
# If embedded is set to true in the signers array below, emails don't go out
# and you can embed the signature page in an iFrame by using the
# get_recipient_view method
signers: [
{
embedded: true,
name: 'Test Guy',
email: '[email protected]',
role_name: 'Issuer',
sign_here_tabs: [
{
anchor_string: 'sign_here_1',
anchor_x_offset: '140',
anchor_y_offset: '8'
}
]
},
],
files: [
{ path: '/Users/mhawash/src/rpace/sandbox/docu_sign/test.pdf', name: 'test.pdf' },
],
status: 'sent'
)
puts response # {"errorCode"=>"INVALID_CONTENT_TYPE", "message"=>"Content Type specified is not supported."}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment