Module: HelloSign::Api::Template
- Included in:
- Client
- Defined in:
- lib/hello_sign/api/template.rb
Overview
Contains all the api calls for the Template resource. Take a look at our template form api document for more information about this.
Instance Method Summary collapse
-
#add_user_to_template(opts) ⇒ Template
Gives the specified Account on your team access to a Template.
-
#create_embedded_template_draft(opts) ⇒ Object
Creates a new embedded template draft object that can be launched in an iframe using the claim URL.
-
#delete_template(opts) ⇒ Object
Deletes the Template specified by the id parameter.
-
#get_template(opts) ⇒ HelloSign::Resource::Template
Retrieves the Template specified by the id parameter.
-
#get_templates(opts = {}) ⇒ HelloSign::Resource::ResourceArray
Retrieves the Templates for the current user account.
-
#remove_user_from_template(opts) ⇒ Template
Removes the specified Account’s access to the specified Template.
Instance Method Details
#add_user_to_template(opts) ⇒ Template
Gives the specified Account on your team access to a Template
63 64 65 66 67 |
# File 'lib/hello_sign/api/template.rb', line 63 def add_user_to_template(opts) path = "/template/add_user/#{opts[:template_id]}" opts.delete(:template_id) HelloSign::Resource::Template.new post(path, :body => opts) end |
#create_embedded_template_draft(opts) ⇒ Object
Creates a new embedded template draft object that can be launched in an iframe using the claim URL.
129 130 131 132 133 134 |
# File 'lib/hello_sign/api/template.rb', line 129 def (opts) opts[:client_id] ||= self.client_id prepare_files opts prepare_signer_roles opts HelloSign::Resource::TemplateDraft.new post("/template/create_embedded_draft", :body => opts) end |
#delete_template(opts) ⇒ Object
Deletes the Template specified by the id parameter.
33 34 35 |
# File 'lib/hello_sign/api/template.rb', line 33 def delete_template(opts) post("/template/delete/#{opts[:template_id]}") end |
#get_template(opts) ⇒ HelloSign::Resource::Template
Retrieves the Template specified by the id parameter.
22 23 24 |
# File 'lib/hello_sign/api/template.rb', line 22 def get_template(opts) HelloSign::Resource::Template.new get("/template/#{opts[:template_id]}") end |
#get_templates(opts = {}) ⇒ HelloSign::Resource::ResourceArray
Retrieves the Templates for the current user account.
46 47 48 49 50 |
# File 'lib/hello_sign/api/template.rb', line 46 def get_templates(opts={}) path = '/template/list' path += opts[:page] ? "?page=#{opts[:page]}" : '' HelloSign::Resource::ResourceArray.new get(path, opts), 'templates', HelloSign::Resource::Template end |
#remove_user_from_template(opts) ⇒ Template
Removes the specified Account’s access to the specified Template. The user can be designated using their account ID or email address.
80 81 82 83 84 |
# File 'lib/hello_sign/api/template.rb', line 80 def remove_user_from_template(opts) path = "/template/remove_user/#{opts[:template_id]}" opts.delete(:template_id) HelloSign::Resource::Template.new post(path, :body => opts) end |