ClubManager.Api

<back to all web services

FindMember

Requires Authentication
Required role:API
The following routes are available for this service:
All Verbs/api/Query/Member
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryBase:
    skip: Optional[int] = None
    take: Optional[int] = None
    order_by: Optional[str] = None
    order_by_desc: Optional[str] = None
    include: Optional[str] = None
    fields: Optional[str] = None
    meta: Optional[Dict[str, str]] = None


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryDb(Generic[T], QueryBase, IReturn[QueryResponse[T]]):
    @staticmethod
    def response_type(): return QueryResponse[T]


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LossReasonInstance:
    loss_reason_id: Optional[int] = None
    reason: Optional[str] = None
    deleted: Optional[bool] = None
    demo: Optional[bool] = None
    selectable: Optional[bool] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserInstance:
    user_id: Optional[int] = None
    user_name: Optional[str] = None
    name: Optional[str] = None
    email: Optional[str] = None
    mobile_phone: Optional[str] = None
    enabled: Optional[bool] = None
    last_login: Optional[datetime.datetime] = None
    created: Optional[datetime.datetime] = None
    training: Optional[bool] = None
    deleted: Optional[bool] = None
    courses_completed: Optional[int] = None
    display_home_notification: Optional[bool] = None
    two_factor_enabled: Optional[bool] = None
    email_confirmed: Optional[bool] = None
    mobile_phone_confirmed: Optional[bool] = None
    notifications: Optional[bool] = None
    change_password: Optional[datetime.datetime] = None
    activated: Optional[datetime.datetime] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MemberInstance:
    member_id: Optional[int] = None
    member_type: Optional[int] = None
    membership_number: Optional[str] = None
    card_number: Optional[str] = None
    company_name: Optional[str] = None
    surname: Optional[str] = None
    forenames: Optional[str] = None
    title: Optional[str] = None
    gender: Optional[int] = None
    date_of_birth: Optional[datetime.datetime] = None
    address1: Optional[str] = None
    address2: Optional[str] = None
    city: Optional[str] = None
    county: Optional[str] = None
    postcode: Optional[str] = None
    home_phone: Optional[str] = None
    mobile_phone: Optional[str] = None
    email_address: Optional[str] = None
    email_opt_out: Optional[bool] = None
    sms_opt_out: Optional[bool] = None
    phone_opt_out: Optional[bool] = None
    letter_opt_out: Optional[bool] = None
    direct_debit_account_holder: Optional[str] = None
    direct_debit_account_number: Optional[str] = None
    direct_debit_sort_code: Optional[str] = None
    joined_date: Optional[datetime.datetime] = None
    direct_debit_bank_address: Optional[str] = None
    full_name: Optional[str] = None
    external_reference: Optional[str] = None
    photo: Optional[bytes] = None
    photo_modified_date: Optional[datetime.datetime] = None
    notes: Optional[str] = None
    deleted: Optional[bool] = None
    demo: Optional[bool] = None
    use_external_status: Optional[bool] = None
    external_status: Optional[int] = None
    free_text: Optional[str] = None
    member_key: Optional[str] = None
    balance: Optional[Decimal] = None
    credit_limit: Optional[Decimal] = None
    created_date: Optional[datetime.datetime] = None
    modified_date: Optional[datetime.datetime] = None
    deleted_date: Optional[datetime.datetime] = None
    external_source: Optional[int] = None
    retention_metric: Optional[Decimal] = None
    monthly_attendance_frequency: Optional[Decimal] = None
    assigned_to_user_id: Optional[int] = None
    created_by_user_id: Optional[int] = None
    deleted_by_user_id: Optional[int] = None
    loss_reason: Optional[LossReasonInstance] = None
    # @References(typeof(LossReasonInstance))
    loss_reason_id: Optional[int] = None

    won_or_lost: Optional[int] = None
    won_or_lost_date: Optional[datetime.datetime] = None
    gift_aid_permission: Optional[bool] = None
    photo_permission: Optional[bool] = None
    first_aid_permission: Optional[bool] = None
    emergency_contact: Optional[str] = None
    won_or_lost_by_user: Optional[UserInstance] = None
    # @References(typeof(UserInstance))
    won_or_lost_by_user_id: Optional[int] = None

    agreed_to_terms: Optional[datetime.datetime] = None
    online_booking_banned: Optional[bool] = None
    country: Optional[str] = None
    fingerprint_enrolled: Optional[datetime.datetime] = None
    last_payment_amount: Optional[Decimal] = None
    pin: Optional[str] = None
    prospecting_points: Optional[int] = None
    achievement_points: Optional[int] = None
    parent_forenames: Optional[str] = None
    parent_surname: Optional[str] = None


# @AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Member")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FindMember(QueryDb[MemberInstance]):
    pass


T = TypeVar('T')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class QueryResponse(Generic[T]):
    offset: Optional[int] = None
    total: Optional[int] = None
    results: Optional[List[T]] = None
    meta: Optional[Dict[str, str]] = None
    response_status: Optional[ResponseStatus] = None

Python FindMember DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/Query/Member HTTP/1.1 
Host: api.clubmanagercentral.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Skip: 0,
	Take: 0,
	OrderBy: String,
	OrderByDesc: String,
	Include: String,
	Fields: String,
	Meta: 
	{
		String: String
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Offset: 0,
	Total: 0,
	Results: 
	[
		{
			MemberId: 0,
			MemberType: 0,
			MembershipNumber: String,
			CardNumber: String,
			CompanyName: String,
			Surname: String,
			Forenames: String,
			Title: String,
			Gender: 0,
			DateOfBirth: 0001-01-01,
			Address1: String,
			Address2: String,
			City: String,
			County: String,
			Postcode: String,
			HomePhone: String,
			MobilePhone: String,
			EmailAddress: String,
			EmailOptOut: False,
			SmsOptOut: False,
			PhoneOptOut: False,
			LetterOptOut: False,
			DirectDebitAccountHolder: String,
			DirectDebitAccountNumber: String,
			DirectDebitSortCode: String,
			JoinedDate: 0001-01-01,
			DirectDebitBankAddress: String,
			FullName: String,
			ExternalReference: String,
			Photo: AA==,
			PhotoModifiedDate: 0001-01-01,
			Notes: String,
			Deleted: False,
			Demo: False,
			UseExternalStatus: False,
			ExternalStatus: 0,
			FreeText: String,
			MemberKey: 00000000000000000000000000000000,
			Balance: 0,
			CreditLimit: 0,
			CreatedDate: 0001-01-01,
			ModifiedDate: 0001-01-01,
			DeletedDate: 0001-01-01,
			ExternalSource: 0,
			RetentionMetric: 0,
			MonthlyAttendanceFrequency: 0,
			AssignedToUserId: 0,
			CreatedByUserId: 0,
			DeletedByUserId: 0,
			LossReason: 
			{
				LossReasonId: 0,
				Reason: String,
				Deleted: False,
				Demo: False,
				Selectable: False
			},
			LossReasonId: 0,
			WonOrLost: 0,
			WonOrLostDate: 0001-01-01,
			GiftAidPermission: False,
			PhotoPermission: False,
			FirstAidPermission: False,
			EmergencyContact: String,
			WonOrLostByUser: 
			{
				UserId: 0,
				UserName: String,
				Name: String,
				Email: String,
				MobilePhone: String,
				Enabled: False,
				LastLogin: 0001-01-01,
				Created: 0001-01-01,
				Training: False,
				Deleted: False,
				CoursesCompleted: 0,
				DisplayHomeNotification: False,
				TwoFactorEnabled: False,
				EmailConfirmed: False,
				MobilePhoneConfirmed: False,
				Notifications: False,
				ChangePassword: 0001-01-01,
				Activated: 0001-01-01
			},
			WonOrLostByUserId: 0,
			AgreedToTerms: 0001-01-01,
			OnlineBookingBanned: False,
			Country: String,
			FingerprintEnrolled: 0001-01-01,
			LastPaymentAmount: 0,
			Pin: String,
			ProspectingPoints: 0,
			AchievementPoints: 0,
			ParentForenames: String,
			ParentSurname: String
		}
	],
	Meta: 
	{
		String: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}