MWS: Overview of Member API calls

Overview of Member API calls

AddAccountDetails(Account accountDetails)

This method enables adding, modifying and deleting members’ accounts.

AddCorrespondence(obj Request)

This method adds a new correspondence record for the given member.

AddPicture(int MemberId, string base64EncodedImage)

Add a picture to the Plus2 database for a given memberID.

AmendLoyalty(int memberID, int loyaltyAmountChange)

Call this to amend the loyalty points of a member’s record in the Plus2 database. The amendAmount can be positive or negative within the bounds of an int. The client must already know the memberID to use this webmethod.

CheckMember(string firstname, string lastname, DateTime birthDate)

Use CheckMember to find out if an existing member on the customer’s system without a memberID exists within the Plus2 database. If they do their memberID will be returned and be aware of a possible limitation of this method - if there are two (or more) records in the Plus2 database with the same firstname, lastname and birthDate then an exception will be thrown. There isn’t a way to determine the correct record without compromising the data of the other member. This member’s memberID must be obtained by a manual business process rather than an automated one.

CheckMemberEmail(string email)

Use checkMemberEmail to get an array of members that use that email as either their work or home email.

CheckMemberID(int memberId)

Call this method to determine if a member record exists for the given id.

CheckMemberLogin(LoginIdentificationType LoginId, string idValue, LoginValidationType loginValidationType, string validationValue)

Call this method to check the member login information. If it is matched then it returns the member id. 0 will be returned if the member login is invalid or the member does not exist in the database.

CleanupMemberChanges(string systemName)

Used in conjunction with Integration Manager. Call this method to delete committed member change records for a given system. Call this method infrequently – typically once a day, at a quiet time. Running it could cause database blocking.

CommitMemberChanges(string systemName, int runId)

Used in conjunction with Integration Manager. Call this method to mark as committed member update records for a given system and run id. Call this method after calling GetMemberChanges and successfully storing those updated records in a third-party system. If this method is not run, the next time GetMemberChanges is run, it will include the same records as previously, plus any additional changed records.

CreateMember(Member newMember)

This webmethod will insert a new member into the Plus2 database. This will occur when a member is present on the customer’s other system but without a memberID in their record. CreateMember calls CheckMember first in order to see whether a duplicate member exists. If so, CreateMember returns -1. If successful, the member id of the newly created member is returned.

CreateOrUpdateMember(Member inputMember)

This method provides access to either member creation or member updating, the decision as to which is appropriate will be based on the input member if the memberid is already known it will be quicker to use editmember if the memberid is not known submit the input member with and id of 0 and the code will decide if a update or insert is needed based on first name, last name and date of birth

CreateValidMember(Member newMember, bool isDuplicateAllowed)

This method works in the same way as CreateMember, but the duplicate checking is extended. If isDuplicateAllowed is true, a member can be created even if another member in the database matches certain key fields. If isDuplicateAllowed is false, a member can be created only if no duplicate records are found when searching by first name, last name, login id, date of birth, email address and postcode (if these fields are entered).

EditMember(Member updatedMember)

This web method should be used if a member in the customer’s system has some details updated (e.g. change of address). If the member doesn’t have a memberID Checkmember can be used to get it. Then either a blank Member object can be populated or RetrieveMember can be used to return a populated Member object that can be amended and returned to EditMember.

EditMember can be used to update the member’s cardID, for example if their old card was lost or stolen then a flag will be available in the Member object to indicate whether the old cardID should be hotlisted.

GetAttendanceHistory(int memberId, DateTime startDateTime, DateTime endDateTime, string siteId, int rowCount)

This will return an array of the attendance records for a member between the startDateTime and endDateTime. If siteId is specified, only records for that site are returned. The number of rows returned is limited in size by the rowCount parameter

GetCorrespondence(obj FilterDetails)

Call this method to retrieve correspondence from a given set of members. The response will contain a number of correspondence objects, depending on the data stored in the system, with a SuccessFailureWithMessage object.

GetMemberBookings(int memberId, bool futureOnly)

This will return an array of the bookings made by a member. If futureOnly is true, only bookings starting in the future will be returned.

GetBookingsWithProducts(int memberId, DateTime earliestStart)

Returns an array of bookings a member has made, including any booked activity's resource product groups. If futureOnly is true, only bookings starting in the future will be returned.

GetMemberChanges(string systemName, int lastRunId, ref int runId)

Used in conjunction with Integration Manager. Call this method to return a list of all members whose records in Plus2 have been edited since the last time this method was run for the given system, and since the last run with the given id. The current run is returned in the runId parameter. After these updates have been recorded in your third-party system, call CommitMemberChanges, passing in the same systemName and runId.

GetMemberChangesPaged(string SystemName, int LastRunID, int PageSize)

Similar to GetMemberChanges, but allows the calling application to specify page size. A page size of 500 is suggested.

GetMemberPicture(int memberId)

Get a picture from the Plus2 pictures database for a given memberID.

GetMemberRelationList(string memberId, string sort, int rowIndex, int maxPageCount, out int totalCount)

Call this method to determine if a member in the Plus2 database is linked to any other member.

GetMemberSearch(string firstName, string lastName, string emailAddress, string homeTelephone, string mobileTelephone, string workTelephone, string postcode, int memberId, DateTime birthDate, string sort, int rowIndex, int maxPageCount, out int totalCount)

Call this method to determine if a member record exists in the Plus2 database for the details specified.

GetMemberSubscriptions(int memberId)

Call this method to return an array of the subscriptions held by a member.

GetScreenProfileList(string profileId)

Return a list of required fields for a given Screen Profile in the Plus2 database.

GetTemplateMember()

Call this method to return a valid template member that you can then amend and use when calling CreateMember.

MemberSearchByCardID(string cardID)

Search for a member by their card id. The method returns 0 if there is no match or 1 if there is a match and throws an exception if multiple records are found.

MemberSearchByUserField(string userFieldName, string UserFieldValue)

Find a member by a user field name and corresponding value.

RecordAttendance(obj request)

This method will record an attendance for a given member. An attendance can be recorded against either a booking or an entry point.  A SuccessFailureWithMessage is returned.

RegisterMemberForThirdPartySystem(obj request)

This method allows members to be register against a given 3rd party system. The results of GetMemberChanges or GetMemberChangesPaged will be filtered by the given 3rd party system and will return updates for these members.

RetrieveLoyalty(int memberID)

Call this with memberID as a parameter to return the loyalty points for the member in the Plus2 database.

RetrieveMember(int memberID)

This webmethod should be called when the client wishes to retrieve a member record from the Plus2 database. A Member object (class available through WSI) will be returned. This is likely to be used is in conjunction with EditMember. The Plus2 memberID should be passed as a parameter.

UnHotlistCard(string cardID)

This webmethod should be called when the client wishes to remove a card from the hotlist of invalid cards, stored within the Plus2 database.

UnRegisterMemberForThirdPartySystem(obj request)

This method allows members to be unregistered from a given 3rd party system. The results of GetMemberChanges or GetMemberChangesPaged will be filtered by the given 3rd party system will no longer return updates for these members.

VerifyMember(MemberFilter filters)

Call this method to determine if the member already exists in the DB and return all members with matching records against the supplied parameters.