Module: FullContact::Client::User

Included in:
FullContact::Client
Defined in:
lib/fullcontact/client/user.rb

Instance Method Summary collapse

Instance Method Details

#authenticate(options = {}) ⇒ Object

Public: Authenticate a user using the username and password. If authenticated, sets the returned access_token in a access_token config variable

options - a hash containing the user’s username and password

Example

FullContact.authenticate({ :username => '[email protected]',
                           :password => 'grizzlybear' })
# we're authenticated now
contact_lists = FullContact.get_contact_lists


16
17
18
19
20
21
22
23
24
25
# File 'lib/fullcontact/client/user.rb', line 16

def authenticate(options = {})
  self.endpoint = 'https://api.fullcontact.com/auth/'
  self.format = ''
  access_token = post('token', options)

  FullContact.configure do |config|
    config.access_token = access_token
  end

end