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.
-
#release_hold_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Releases a held SignatureRequest that was claimed and prepared from an UnclaimedDraft.
-
#release_on_hold_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Releases a held SignatureRequest that was claimed and prepared from an UnclaimedDraft.
-
#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.
327 328 329 330 331 332 333 334 335 |
# File 'lib/hello_sign/api/signature_request.rb', line 327 def bulk_send_with_template(opts) opts[:client_id] ||= self.client_id 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.
435 436 437 |
# File 'lib/hello_sign/api/signature_request.rb', line 435 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.
559 560 561 562 563 564 565 566 567 568 |
# File 'lib/hello_sign/api/signature_request.rb', line 559 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.
638 639 640 641 642 643 644 645 646 647 |
# File 'lib/hello_sign/api/signature_request.rb', line 638 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.
402 403 404 405 406 407 408 409 410 |
# File 'lib/hello_sign/api/signature_request.rb', line 402 def (opts) opts[:client_id] ||= self.client_id 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 |
#release_hold_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Releases a held SignatureRequest that was claimed and prepared from an UnclaimedDraft.
686 687 688 |
# File 'lib/hello_sign/api/signature_request.rb', line 686 def release_hold_signature_request(opts) HelloSign::Resource::SignatureRequest.new post("/signature_request/release_hold/#{opts[:signature_request_id]}", body: opts) end |
#release_on_hold_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Releases a held SignatureRequest that was claimed and prepared from an UnclaimedDraft.
656 657 658 |
# File 'lib/hello_sign/api/signature_request.rb', line 656 def release_on_hold_signature_request(opts) HelloSign::Resource::SignatureRequest.new post("/signature_request/release_hold/#{opts[:signature_request_id]}", body: opts) end |
#remind_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Sends an email reminder to the signer about the SignatureRequest.
424 425 426 |
# File 'lib/hello_sign/api/signature_request.rb', line 424 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.
446 447 448 |
# File 'lib/hello_sign/api/signature_request.rb', line 446 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.
171 172 173 174 175 176 177 178 179 180 |
# File 'lib/hello_sign/api/signature_request.rb', line 171 def send_signature_request(opts) opts[:client_id] ||= self.client_id 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.
252 253 254 255 256 257 258 259 260 261 |
# File 'lib/hello_sign/api/signature_request.rb', line 252 def send_signature_request_with_template(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/send_with_template', body: opts) end |
#signature_request_files(opts) ⇒ Object
Downloads a copy of the SignatureRequest documents.
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/hello_sign/api/signature_request.rb', line 459 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.
673 674 675 676 677 |
# File 'lib/hello_sign/api/signature_request.rb', line 673 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 |