module WebLogins

Public Instance Methods

create_web_login(constituent, email_id, email, login_type, primary, temporary, options={}) click to toggle source
# File lib/tessitura_rest/crm/web_logins.rb, line 9
def create_web_login(constituent, email_id, email, login_type, primary, temporary, options={})
  parameters = {
    'Constituent': {
      'Id': constituent,
    },
    'Email': {
      'Id': email_id,
    },
    'FailedAttempts': 3,
    'Inactive': false,
    'Login': email,
    'LoginType': {
      'Id': login_type,
    },
    'PrimaryIndicator': primary,
    'TemporaryIndicator': temporary,
  }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters)
  self.class.post(base_api_endpoint('CRM/WebLogins'), options)
end
get_web_login(email, login_type, options={}) click to toggle source
# File lib/tessitura_rest/crm/web_logins.rb, line 3
def get_web_login(email, login_type, options={})
  options.merge!(basic_auth: @auth, headers: @headers)
  response = self.class.get(base_api_endpoint("CRM/WebLogins/Search?emailAddress=#{email}&loginTypeId=#{login_type}"), options)
  JSON.parse(response.body)
end