Sha256: 9611625419a62271577cc9f6986409ed721e661357e4a1730965ca047c958dd6

Contents?: true

Size: 901 Bytes

Versions: 31

Compression:

Stored size: 901 Bytes

Contents

module WebLogins

  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

  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

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
tessitura_rest-1.1.6 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-1.1.5 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-1.1.4 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-1.1.3 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-1.1.2 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-1.1.1 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-1.1.0 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-1.0.0 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.9.1.3 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.9.1.2 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.9.1.1 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.9.1 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.9.0 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.8.9 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.8.8 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.8.7 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.8.6.9 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.8.6.8 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.8.6.7 lib/tessitura_rest/crm/web_logins.rb
tessitura_rest-0.8.6.6 lib/tessitura_rest/crm/web_logins.rb