Method: HelloSign::Api::SignatureRequest#signature_request_files

Defined in:
lib/hello_sign/api/signature_request.rb

#signature_request_files(opts) ⇒ Object

Downloads a copy of the SignatureRequest documents.

Examples:

pdf = @client.signature_request_files signature_request_id: '75cdf7dc8b323d43b347e4a3614d1f822bd09491'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • signature_request_id (String)

    The ID of the SignatureRequest to download.

  • file_type (String)

    Determines the format of the file - either ‘pdf’ or ‘zip’ depending on the file type desired. Defaults to pdf. (optional)

  • get_url (Boolean)

    Response contains a URL link to the file if set to true. Links are only available for PDFs and have a TTL of 3 days. Defaults to false. (optional)

Returns:

  • a PDF or Zip



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/hello_sign/api/signature_request.rb', line 452

def signature_request_files(opts)
  path = "/signature_request/files/#{opts[:signature_request_id]}"
  if opts[:file_type]
    path = path + "?file_type=#{opts[:file_type]}"
  end

  if opts[:get_url]
    separator = opts[:file_type].nil? ? '?' : '&'
    path = path + "#{separator}get_url=#{opts[:get_url]}"
  elsif opts[:get_data_uri]
    separator = opts[:file_type].nil? ? '?' : '&'
    path = path + "#{separator}get_data_uri=#{opts[:get_data_uri]}"
  end

  get(path)[:body]
end