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 on Signature Requests (app.hellosign.com/api/reference#SignatureRequest) for more information about this.
Instance Method Summary collapse
-
#bulk_send_with_template(opts) ⇒ HelloSign::Resource::BulkSendJob
Creates a BulkSendJob based off of the Template specified with the template_id parameter.
-
#cancel_signature_request(opts) ⇒ HTTP::Status
Cancels an incomplete 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.
-
#embedded_bulk_send_with_template(opts) ⇒ HelloSign::Resource::BulkSendJob
Creates an embedded BulkSendJob based off of the Template specified with the template_id parameter.
-
#get_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Retrieves a SignatureRequest with the given ID.
-
#get_signature_requests(opts = {}) ⇒ HelloSign::Resource::ResourceArray
Returns a list of send and received SignatureRequests that you can access.
-
#remind_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Sends an email reminder to the signer about the SignatureRequest.
-
#remove_signature_request(opts) ⇒ HTTP::Status
Removes your access to a completed a SignatureRequest.
-
#send_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates and sends a new SignatureRequest with the submitted documents.
-
#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
Downloads a copy of the SignatureRequest documents.
-
#update_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Updates the email address on a SignatureRequest.
Instance Method Details
#bulk_send_with_template(opts) ⇒ HelloSign::Resource::BulkSendJob
Creates a BulkSendJob based off of the Template specified with the template_id parameter.
322 323 324 325 326 327 328 329 |
# File 'lib/hello_sign/api/signature_request.rb', line 322 def bulk_send_with_template(opts) prepare_bulk_signers opts prepare_ccs opts prepare_templates opts prepare_custom_fields opts HelloSign::Resource::BulkSendJob.new post('/signature_request/bulk_send_with_template', body: opts) end |
#cancel_signature_request(opts) ⇒ HTTP::Status
Cancels an incomplete SignatureRequest.
428 429 430 |
# File 'lib/hello_sign/api/signature_request.rb', line 428 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. See our Embedded Signing Walkthrough for more information on Embedded Signing: app.hellosign.com/api/embeddedSigningWalkthrough.
552 553 554 555 556 557 558 559 560 561 |
# File 'lib/hello_sign/api/signature_request.rb', line 552 def (opts) opts[:client_id] ||= self.client_id prepare_files opts prepare_signers opts prepare_form_fields opts prepare_custom_fields opts 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. See our Embedded Signing Walkthrough for more information on Embedded Signing: app.hellosign.com/api/embeddedSigningWalkthrough.
631 632 633 634 635 636 637 638 639 640 |
# File 'lib/hello_sign/api/signature_request.rb', line 631 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 |
#embedded_bulk_send_with_template(opts) ⇒ HelloSign::Resource::BulkSendJob
Creates an embedded BulkSendJob based off of the Template specified with the template_id parameter.
396 397 398 399 400 401 402 403 |
# File 'lib/hello_sign/api/signature_request.rb', line 396 def (opts) prepare_bulk_signers opts prepare_ccs opts prepare_templates opts prepare_custom_fields opts HelloSign::Resource::BulkSendJob.new post('/signature_request/bulk_create_embedded_with_template', body: opts) end |
#get_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Retrieves a SignatureRequest with the given ID. signature_request = @client.get_signature_request signature_request_id: ‘fa5c8a0b0f492d768749333ad6fcc214c111e967’
40 41 42 43 44 |
# File 'lib/hello_sign/api/signature_request.rb', line 40 def get_signature_request(opts) path = "/signature_request/#{opts[:signature_request_id]}" HelloSign::Resource::SignatureRequest.new get(path) end |
#get_signature_requests(opts = {}) ⇒ HelloSign::Resource::ResourceArray
Returns a list of send and received SignatureRequests that you can access. This does not include ones that you have been CC’d on. signature_requests = @client.get_signature_requests(
page: 1,
query: "to:[email protected]+AND+client_id:b6b8e7deaf8f0b95c029dca049356d4a2cf9710a"
)
59 60 61 62 63 64 65 |
# File 'lib/hello_sign/api/signature_request.rb', line 59 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, :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 reminder to the signer about the SignatureRequest.
417 418 419 |
# File 'lib/hello_sign/api/signature_request.rb', line 417 def remind_signature_request(opts) HelloSign::Resource::SignatureRequest.new post("/signature_request/remind/#{opts[:signature_request_id]}", body: opts) end |
#remove_signature_request(opts) ⇒ HTTP::Status
Removes your access to a completed a SignatureRequest.
439 440 441 |
# File 'lib/hello_sign/api/signature_request.rb', line 439 def remove_signature_request(opts) post("/signature_request/remove/#{opts[:signature_request_id]}", body: opts) end |
#send_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates and sends a new SignatureRequest with the submitted documents.
170 171 172 173 174 175 176 177 178 |
# File 'lib/hello_sign/api/signature_request.rb', line 170 def send_signature_request(opts) prepare_files opts prepare_signers opts prepare_form_fields opts prepare_custom_fields opts 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.
249 250 251 252 253 254 255 256 257 |
# File 'lib/hello_sign/api/signature_request.rb', line 249 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
Downloads a copy of the SignatureRequest documents.
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 |
#update_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Updates the email address on a SignatureRequest.
655 656 657 658 659 |
# File 'lib/hello_sign/api/signature_request.rb', line 655 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 |