class UplandMobileCommonsRest::Profiles

Public Instance Methods

base_path() click to toggle source
# File lib/upland_mobile_commons_rest/profiles.rb, line 3
def base_path
  'profile'
end
get(phone_number) click to toggle source
# File lib/upland_mobile_commons_rest/profiles.rb, line 7
def get(phone_number)
  resp = client.get_request("#{base_path}?phone_number=#{CGI.escape(phone_number)}")
  resp.body['response']['profile']
# API returns error id '5' (invalid phone number) when profile with phone number is not found
rescue UplandMobileCommonsRest::InvalidPhoneNumber
  nil
end
update(params) click to toggle source
# File lib/upland_mobile_commons_rest/profiles.rb, line 15
def update(params)
  client.post_request('profile_update', params)
end