Method: LoopsRails::Contacts#find

Defined in:
lib/loops_rails/client/contacts.rb

#find(email: nil, user_id: nil) ⇒ Object

Raises:

  • (ArgumentError)


23
24
25
26
27
28
29
30
31
32
33
# File 'lib/loops_rails/client/contacts.rb', line 23

def find(email: nil, user_id: nil)
  raise ArgumentError, "Either email or user_id must be provided" if email.nil? && user_id.nil?

  params = { email: email, userId: user_id }.compact

  response = @conn.get("contacts/find") do |req|
    req.params = params
  end

  parse_response(response)
end