Module: HelloSign::Api::Team

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

Overview

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

Author:

  • hellosign

Instance Method Summary collapse

Instance Method Details

#add_member_to_team(opts) ⇒ HelloSign::Resource::Team

Adds or invites a user (specified using the email_address parameter) to the Team. If the user does not currently have a HelloSign Account, a new one will be created for them. If the user currently has a paid subscription, they will be emailed an invitation to join the Team. If a user is already a part of a Team, a “team_invite_failed” error will be returned. Note: The account_id prevails if both email_address and acccount_id are provided.

Examples:

team = @client.add_member_to_team :email_address => '[email protected]'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • account_id (String)

    The user’s Account ID to invite to the Team.

  • email_address (String)

    The user’s email address to invite to your Team.

Returns:



93
94
95
# File 'lib/hello_sign/api/team.rb', line 93

def add_member_to_team(opts)
  HelloSign::Resource::Team.new post('/team/add_member', :body => opts)
end

#create_team(opts) ⇒ HelloSign::Resource::Team

Creates a new Team and makes you a member. You must not currently belong to a Team to invoke.

Examples:

team = @client.create_team :name => 'Team America World Police'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • name (String)

    The name of the Team.

Returns:



55
56
57
# File 'lib/hello_sign/api/team.rb', line 55

def create_team(opts)
  HelloSign::Resource::Team.new post('/team/create', :body => opts)
end

#destroy_teamObject

Deletes your Team. Can only be invoked with a Team with one member (yourself).

Examples:

team = @client.destroy_team


76
77
78
# File 'lib/hello_sign/api/team.rb', line 76

def destroy_team
  post('/team/destroy')
end

#get_teamHelloSign::Resource::Team

Returns information about your Team as well as a list of its members. If you do not belong to a Team, HelloSign::Error::NotFound will be raised

Examples:

team = @client.get_team

Returns:



43
44
45
# File 'lib/hello_sign/api/team.rb', line 43

def get_team
  HelloSign::Resource::Team.new get('/team')
end

#remove_member_from_team(opts) ⇒ HelloSign::Resource::Team

Removes a user from the Team. If the user had an outstanding invitation to your Team, the original invitation will expire. Note: The account_id prevails if both email_address and acccount_id are provided.

Examples:

team = @client.remove_member_from_team :email_address => '[email protected]'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • account_id (String)

    The user’s Account ID to remove from the Team.

  • email_address (String)

    The user’s email address to remove from your Team.

  • new_owner_email_address (String)

    The Account’s email address to receive all documents, API Apps (if applicable), and API key from removed account. (optional)

Returns:



107
108
109
# File 'lib/hello_sign/api/team.rb', line 107

def remove_member_from_team(opts)
  HelloSign::Resource::Team.new post('/team/remove_member', :body => opts)
end

#update_team(opts) ⇒ HelloSign::Resource::Team

Updates the name of your Team.

Examples:

team = @client.update_team :name => 'New Team Name'

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • name (String)

    The name of your Team.

Returns:



67
68
69
# File 'lib/hello_sign/api/team.rb', line 67

def update_team(opts)
  HelloSign::Resource::Team.new post('/team', :body => opts)
end