Module: HelloSign::Api::Embedded

Included in:
Client
Defined in:
lib/hello_sign/api/embedded.rb

Overview

Contains all the API calls for Embedded SignatureRequests. Take a look at our Embedded Signing Walkthrough (app.hellosign.com/api/embeddedSigningWalkthrough) for more information about this.

Author:

  • hellosign

Instance Method Summary collapse

Instance Method Details

#get_embedded_sign_url(opts) ⇒ HelloSign::Resource::Embedded

Retrieves the sign_url for an Embedded SignatureRequest.

Examples:

embedded = @client.get_embedded_sign_url signature_id: '50e3542f738adfa7ddd4cbd4c00d2a8ab6e4194b'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • signature_id (String)

    The Signature ID to retrieve the embedded sign_url for.

Returns:



40
41
42
# File 'lib/hello_sign/api/embedded.rb', line 40

def get_embedded_sign_url(opts)
  HelloSign::Resource::Embedded.new get("/embedded/sign_url/#{opts[:signature_id]}")
end

#get_embedded_template_edit_url(opts) ⇒ HelloSign::Resource::Embedded

Retrieves the edit_url for an Embedded Template.

Examples:

edit_url = @client.get_embedded_template_edit_url template_id: '39e3387f738adfa7ddd4cbd4c00d2a8ab6e4194b'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • test_mode (Boolean)

    Indicates if this is a test SignatureRequest, it will not be legally binding if set to 1. Defaults to 0. (optional)

  • template_id (String)

    The Template ID to retrieve the embedded edit_url for.

  • cc_roles (Array<Hash>)

    The CC roles that must be assigned when using the Embedded Template to create a SignatureRequest. (optional)

  • merge_fields (String<Array><Hash>)

    List of fields that can be pre-populated by your application when using the Embedded Template to send a SignatureRequest. (optional)

    • name (String) Merge field name

    • type (String) Field type - either “text” or “checkbox”

  • skip_signer_roles (Boolean)

    Removes the prompt to edit signer roles, if already provided. Defaults to 0. (optional)

  • skip_subject_message (Boolean)

    Removes the prompt to edit the subject and message, if already provided. Defaults to 0. (optional)

Returns:



58
59
60
61
62
63
64
65
# File 'lib/hello_sign/api/embedded.rb', line 58

def get_embedded_template_edit_url(opts)
  defaults = { skip_signer_roles: 0, skip_subject_message: 0, test_mode: 0 }
  opts = defaults.merge(opts)

  prepare_merge_fields opts

  HelloSign::Resource::Embedded.new post("/embedded/edit_url/#{opts[:template_id]}", body: opts)
end