Class: YourMembership::Sa::NonMembers

Inherits:
Base
  • Object
show all
Defined in:
lib/your_membership/sa_nonmembers.rb

Overview

YourMembership System Administrator Members Namespace

Class Method Summary collapse

Methods inherited from Base

build_XML_request, new_call_id, post, response_to_array, response_to_array_of_hashes, response_valid?, response_ym_error?

Class Method Details

.all_getIDs(options = {}) ⇒ Array

Returns a list of non-member IDs that may be optionally filtered by timestamp. This method is provided for data synchronization purposes and will return a maximum of 10,000 results. It would typically be used in conjunction with subsequent calls to Sa.People.Profile.Get for each ID returned.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :Timestamp (DateTime)

    Only accounts created after the this time will be returned

  • :WebsiteID (String)

    Filter the returned results by sequential WebsiteID.

  • :Groups (Array)

    Filter the returned results by group membership. [key, value] will translate to <key>value</key>

Returns:

  • (Array)

    A list of API IDs for non-members in your community.

See Also:



18
19
20
21
22
# File 'lib/your_membership/sa_nonmembers.rb', line 18

def self.all_getIDs(options = {}) # rubocop:disable Style/MethodName
  response = post('/', :body => build_XML_request('Sa.NonMembers.All.GetIDs', nil, options))
  response_valid? response
  response['YourMembership_Response']['Sa.NonMembers.All.GetIDs']['NonMembers']['ID']
end

.profile_create(profile) ⇒ Hash

Creates a new non-member profile and returns the new non-member’s ID and WebsiteID. The returned ID must be supplied when performing future updates to the non-member’s profile. The returned WebsiteID represents the numeric identifier used by the YourMembership.com application for navigation purposes.

Parameters:

Returns:

  • (Hash)

    The ID and WebsiteID of the nonmember created

See Also:



32
33
34
35
36
37
38
# File 'lib/your_membership/sa_nonmembers.rb', line 32

def self.profile_create(profile)
  options = {}
  options['profile'] = profile
  response = post('/', :body => build_XML_request('Sa.NonMembers.Profile.Create', nil, options))
  response_valid? response
  response['YourMembership_Response']['Sa.NonMembers.Profile.Create']
end