Module: HelloSign::Api::ApiApp

Included in:
Client
Defined in:
lib/hello_sign/api/api_app.rb

Overview

Contains all the API calls for the ApiApp resource. Take a look at our API Documentation for ApiApps (app.hellosign.com/api/reference#ApiApp) for more information about this.

Author:

  • hellosign

Instance Method Summary collapse

Instance Method Details

#create_api_app(opts) ⇒ HelloSign::Resource::ApiApp

Creates a new API Application on your account

Examples:

app = @client.create_api_app :name => 'My Production App', :domain => 'example.com', :'oauth[callback_url]' => 'https://example.com/oauth', 'oauth[scopes]' => 'basic_account_info,request_signature'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • name (String)

    The name assigned to the ApiApp.

  • domain (String)

    The domain associated with the ApiApp.

  • callback_url (String)

    The URL that will receive callback events for the ApiApp. (optional)

  • custom_logo_file (String)

    An image file to use as a custom logo in embedded workflows, if available in the API subscription. (optional)

  • oauth[callback_url] (String)

    The callback URL to be used for OAuth flows. (optional)

  • oauth[scopes] (String)

    A comma-separated list of OAuth scopes to be granted to the app. (optional)

  • white_labeling_options (String<Hash>)

    Object with elements and values serialized to a string to customize the signer page, if available in the API subscription. (optional)

  • options[can_insert_everywhere] (Boolean)

    Determines if signers can “Insert Everywhere” when signing a document. (optional)

Returns:



81
82
83
# File 'lib/hello_sign/api/api_app.rb', line 81

def create_api_app(opts)
  HelloSign::Resource::ApiApp.new post('/api_app', :body => opts)
end

#delete_api_app(opts) ⇒ Object

Deletes an ApiApp. Only available for ApiApps you own.

Examples:

result = @client.delete_api_app :client_id => 'fa5c8a0b0f492d768749333ad6fcc214c111e967'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • client_id (String)

    The Client ID of the ApiApp you want to delete.



113
114
115
116
# File 'lib/hello_sign/api/api_app.rb', line 113

def delete_api_app(opts)
  path = '/api_app/' + opts[:client_id]
  delete(path)
end

#get_api_app(opts) ⇒ HelloSign::Resource::ApiApp

Retrieves information about a specific API App by a given ID

Examples:

app = @client.get_api_app :client_id => 'fa5c8a0b0f492d768749333ad6fcc214c111e967'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • client_id (String)

    The Client ID of the ApiApp.

Returns:



45
46
47
# File 'lib/hello_sign/api/api_app.rb', line 45

def get_api_app(opts)
  HelloSign::Resource::ApiApp.new get("/api_app/#{opts[:client_id]}")
end

#get_api_apps(opts = {}) ⇒ HelloSign::Resource::ResourceArray

Returns a list of ApiApps that you currently have access to on your account

Examples:

apps = @client.get_api_apps :page => 1

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • page (Integer)

    Sets the page number of the list to return. Defaults to 1. (optional)

  • page_size (Integer)

    Determines the number of ApiApps returned per page. Defaults to 20. (optional)

Returns:



59
60
61
62
63
64
# File 'lib/hello_sign/api/api_app.rb', line 59

def get_api_apps(opts={})
  path = '/api_app/list'
  path += opts[:page] ? "?page=#{opts[:page]}" : ''
  path += opts[:page_size] ? "&page_size=#{opts[:page_size]}" : ''
  HelloSign::Resource::ResourceArray.new get(path, opts), 'api_apps',  HelloSign::Resource::ApiApp
end

#update_api_app(opts) ⇒ HelloSign::Resource::ApiApp

Updates settings for a specific ApiApp on your account

Examples:

app = @client.update_api_app :name => 'My Newly Renamed App', :domain => 'example2.com', :'oauth[callback_url]' => 'https://example2.com/oauth', 'oauth[scopes]' => 'basic_account_info,request_signature'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • client_id (String)

    The Client ID of the ApiApp you want to update.

  • name (String)

    The name assigned to the ApiApp. (optional)

  • domain (String)

    The domain associated with the ApiApp. (optional)

  • callback_url (String)

    The URL that will receive callback events for the ApiApp. (optional)

  • custom_logo_file (String)

    An image file to use as a custom logo in embedded workflows, if available in the API subscription. (optional)

  • oauth[callback_url] (String)

    The callback URL to be used for OAuth flows. (optional)

  • oauth[scopes] (String)

    A comma-separated list of OAuth scopes to be granted to the app. (optional)

  • white_labeling_options (String<Hash>)

    Object with elements and values serialized to a string to customize the signer page, if available in the API subscription. (optional)

  • options[can_insert_everywhere] (Boolean)

    Determines if signers can “Insert Everywhere” when signing a document. (optional)

Returns:



101
102
103
104
105
# File 'lib/hello_sign/api/api_app.rb', line 101

def update_api_app(opts)
  id = opts.delete(:client_id)
  path = '/api_app/' + id
  HelloSign::Resource::ApiApp.new post(path, :body => opts)
end