Module: HelloSign::Api::SignatureRequest
- Included in:
- Client
- Defined in:
- lib/hello_sign/api/signature_request.rb
Overview
Contains all the API calls for the SignatureRequest resource. Take a look at our API Documentation for sending Signature Requests (app.hellosign.com/api/reference#SignatureRequest) for more information about this.
Instance Method Summary collapse
-
#cancel_signature_request(opts) ⇒ Object
Cancels a SignatureRequest.
-
#create_embedded_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame.
-
#create_embedded_signature_request_with_template(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates a new SignatureRequest based on the given Template to be signed in an embedded iFrame.
-
#get_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Retrieves a Signature Request with the given ID.
-
#get_signature_requests(opts = {}) ⇒ HelloSign::Resource::ResourceArray
Returns a list of SignatureRequests that you can access.
-
#remind_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Sends an email to the signer reminding them to sign the signature request.
-
#remove_signature_request(opts) ⇒ Object
Removes your access to a completed a SignatureRequest.
-
#send_signature_request(opts) ⇒ Object
).
-
#send_signature_request_with_template(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates and sends a new SignatureRequest based off of the Template specified with the template_id parameter.
-
#signature_request_files(opts) ⇒ Object
Download a copy of the SignatureRequest documents specified by the signature_request_id parameter.
-
#update_signature_request(opts) ⇒ Object
Updates the email address on a SignatureRequest.
Instance Method Details
#cancel_signature_request(opts) ⇒ Object
Cancels a SignatureRequest.
282 283 284 |
# File 'lib/hello_sign/api/signature_request.rb', line 282 def cancel_signature_request(opts) post("/signature_request/cancel/#{opts[:signature_request_id]}", :body => opts) end |
#create_embedded_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified or use_text_tags is not enabled, a signature page will be affixed at the end and all signers will be required to add their signature there. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on HelloSign.com. See our Embedded Signing Walkthrough for more information on Embedded Signing: app.hellosign.com/api/embeddedSigningWalkthrough
378 379 380 381 382 383 384 385 386 |
# File 'lib/hello_sign/api/signature_request.rb', line 378 def (opts) opts[:client_id] ||= self.client_id prepare_files opts prepare_signers opts prepare_form_fields opts prepare_custom_fields opts HelloSign::Resource::SignatureRequest.new post('/signature_request/create_embedded', :body => opts) end |
#create_embedded_signature_request_with_template(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates a new SignatureRequest based on the given Template to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on HelloSign.
448 449 450 451 452 453 454 455 456 457 |
# File 'lib/hello_sign/api/signature_request.rb', line 448 def (opts) opts[:client_id] ||= self.client_id prepare_signers opts prepare_ccs opts prepare_templates opts prepare_custom_fields opts prepare_files opts HelloSign::Resource::SignatureRequest.new post('/signature_request/create_embedded_with_template', :body => opts) end |
#get_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Retrieves a Signature Request with the given ID.
46 47 48 49 50 51 |
# File 'lib/hello_sign/api/signature_request.rb', line 46 def get_signature_request(opts) path = "/signature_request/#{opts[:signature_request_id]}" query = create_query_string(opts, [:ux_version]) path += query HelloSign::Resource::SignatureRequest.new get(path) end |
#get_signature_requests(opts = {}) ⇒ HelloSign::Resource::ResourceArray
Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CC’d on.
65 66 67 68 69 70 71 |
# File 'lib/hello_sign/api/signature_request.rb', line 65 def get_signature_requests(opts={}) path = '/signature_request/list' opts[:query] = create_search_string(opts[:query]) if opts[:query] query = create_query_string(opts, [:page, :page_size, :ux_version, :query]) path += query HelloSign::Resource::ResourceArray.new get(path, opts), 'signature_requests', HelloSign::Resource::SignatureRequest end |
#remind_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Sends an email to the signer reminding them to sign the signature request.
272 273 274 |
# File 'lib/hello_sign/api/signature_request.rb', line 272 def remind_signature_request(opts) HelloSign::Resource::SignatureRequest.new post("/signature_request/remind/#{opts[:signature_request_id]}", :body => opts) end |
#remove_signature_request(opts) ⇒ Object
Removes your access to a completed a SignatureRequest.
292 293 294 |
# File 'lib/hello_sign/api/signature_request.rb', line 292 def remove_signature_request(opts) post("/signature_request/remove/#{opts[:signature_request_id]}", :body => opts) end |
#send_signature_request(opts) ⇒ Object
)
155 156 157 158 159 160 161 162 |
# File 'lib/hello_sign/api/signature_request.rb', line 155 def send_signature_request(opts) prepare_files opts prepare_signers opts prepare_form_fields opts prepare_custom_fields opts request = HelloSign::Resource::SignatureRequest.new post('/signature_request/send', :body => opts) end |
#send_signature_request_with_template(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates and sends a new SignatureRequest based off of the Template specified with the template_id parameter.
252 253 254 255 256 257 258 259 260 |
# File 'lib/hello_sign/api/signature_request.rb', line 252 def send_signature_request_with_template(opts) prepare_signers opts prepare_ccs opts prepare_templates opts prepare_custom_fields opts prepare_files opts HelloSign::Resource::SignatureRequest.new post('/signature_request/send_with_template', :body => opts) end |
#signature_request_files(opts) ⇒ Object
Download a copy of the SignatureRequest documents specified by the signature_request_id parameter.
307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/hello_sign/api/signature_request.rb', line 307 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]}" end get(path)[:body] end |
#update_signature_request(opts) ⇒ Object
Updates the email address on a SignatureRequest.
472 473 474 475 476 |
# File 'lib/hello_sign/api/signature_request.rb', line 472 def update_signature_request(opts) signature_request_id = opts.delete(:signature_request_id) path = "/signature_request/update/#{signature_request_id}" HelloSign::Resource::SignatureRequest.new post(path, :body => opts) end |