Module: HelloSign::Api::SignatureRequest
- Included in:
- Client
- Defined in:
- lib/hello_sign/api/signature_request.rb
Overview
Contains all the api about the SignatureRequest resource. Take a look at our signature request api document 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.
-
#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
Download the PDF copy of the current documents specified by the signature_request_id parameter.
Instance Method Details
#cancel_signature_request(opts) ⇒ Object
Cancels a SignatureRequest.
220 221 222 |
# File 'lib/hello_sign/api/signature_request.rb', line 220 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, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on HelloSign.
288 289 290 291 292 293 294 |
# File 'lib/hello_sign/api/signature_request.rb', line 288 def (opts) opts[:client_id] ||= self.client_id prepare_files opts prepare_signers 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.
346 347 348 349 350 351 352 353 |
# File 'lib/hello_sign/api/signature_request.rb', line 346 def (opts) opts[:client_id] ||= self.client_id prepare_signers opts prepare_ccs opts prepare_templates 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 |
# File 'lib/hello_sign/api/signature_request.rb', line 46 def get_signature_request(opts) HelloSign::Resource::SignatureRequest.new get("/signature_request/#{opts[:signature_request_id]}") 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 CCed on.
59 60 61 62 63 64 |
# File 'lib/hello_sign/api/signature_request.rb', line 59 def get_signature_requests(opts={}) path = '/signature_request/list' path += opts[:page] ? "?page=#{opts[:page]}" : '' path += opts[:page_size] ? "&page_size=#{opts[:page_size]}" : '' 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.
210 211 212 |
# File 'lib/hello_sign/api/signature_request.rb', line 210 def remind_signature_request(opts) HelloSign::Resource::SignatureRequest.new post("/signature_request/remind/#{opts[:signature_request_id]}", :body => opts) end |
#send_signature_request(opts) ⇒ HelloSign::Resource::SignatureRequest
Creates and sends a new SignatureRequest with the submitted documents. If form_fields_per_document is not specified, a signature page will be affixed at the end and all signers will be required to add their signature there.
112 113 114 115 116 117 |
# File 'lib/hello_sign/api/signature_request.rb', line 112 def send_signature_request(opts) prepare_files opts prepare_signers opts 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.
193 194 195 196 197 198 199 |
# File 'lib/hello_sign/api/signature_request.rb', line 193 def send_signature_request_with_template(opts) prepare_signers opts prepare_ccs opts prepare_templates opts HelloSign::Resource::SignatureRequest.new post('/signature_request/send_with_template', :body => opts) end |
#signature_request_files(opts) ⇒ Object
Download the PDF copy of the current documents specified by the signature_request_id parameter.
234 235 236 237 238 239 240 |
# File 'lib/hello_sign/api/signature_request.rb', line 234 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 get(path) end |