POST,GET | /api/Member/GetMemberByKey |
---|
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
class Gender(str, Enum):
UNKNOWN = 'Unknown'
MALE = 'Male'
FEMALE = 'Female'
OTHER = 'Other'
PREFER_NOT_TO_SAY = 'PreferNotToSay'
class ExternalStatus(str, Enum):
OFF = 'Off'
ACTIVE = 'Active'
PENDING = 'Pending'
CANCELLED_INSIDE_CONTRACT = 'CancelledInsideContract'
CANCELLED_OUTSIDE_CONTRACT = 'CancelledOutsideContract'
WITH_DEBT_RECOVERY = 'WithDebtRecovery'
SUSPENDED = 'Suspended'
class MemberType(str, Enum):
PROSPECT = 'Prospect'
ACTIVE = 'Active'
CANCELLED = 'Cancelled'
EXPIRED = 'Expired'
SUSPENDED = 'Suspended'
CLUB_CANCELLED = 'ClubCancelled'
DROP_OUT = 'DropOut'
class MembershipState(str, Enum):
PROSPECT = 'Prospect'
ACTIVE = 'Active'
EXPIRED = 'Expired'
CANCELLED = 'Cancelled'
PAYMENT_REQUIRED = 'PaymentRequired'
SUSPENDED = 'Suspended'
# @Flags()
class MessageTemplateContentType(IntEnum):
TRANSACTIONAL = 1
MARKETING = 2
NONE = 1048576
# @Flags()
class MessageTemplateType(IntEnum):
SMS = 1
EMAIL = 2
TELEPHONE = 4
DIRECT_MAIL = 8
NOTIFICATION = 16
PAGE = 32
NONE = 1048576
NO_CONSENT = 2097152
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Member:
member_id: Optional[int] = None
branch_id: Optional[int] = None
membership_number: Optional[str] = None
joined_date: Optional[datetime.datetime] = None
card_number: Optional[str] = None
company_name: Optional[str] = None
gender: Optional[Gender] = None
gender_name: Optional[str] = None
full_name: Optional[str] = None
title: Optional[str] = None
forenames: Optional[str] = None
surname: Optional[str] = None
address1: Optional[str] = None
address2: Optional[str] = None
county: Optional[str] = None
city: Optional[str] = None
home_phone: Optional[str] = None
mobile_phone: Optional[str] = None
email_address: Optional[str] = None
external_reference: Optional[str] = None
country: 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
use_external_status: Optional[bool] = None
external_status: Optional[ExternalStatus] = None
date_of_birth: Optional[datetime.datetime] = None
postcode: Optional[str] = None
notes: Optional[str] = None
start_date: Optional[datetime.datetime] = None
expires: Optional[datetime.datetime] = None
sessions_remaining: Optional[int] = None
contract_end_date: Optional[datetime.datetime] = None
days_remaining: Optional[int] = None
membership_type: Optional[str] = None
last_attendance: Optional[datetime.datetime] = None
attendance: Optional[int] = None
member_type: Optional[MemberType] = None
recurring_payments: Optional[int] = None
overdue_payments: Optional[int] = None
attendance_this_week: Optional[int] = None
retention_metric: Optional[Decimal] = None
monthly_attendance_frequency: Optional[Decimal] = None
total_product_spend: Optional[Decimal] = None
journal_entry: Optional[str] = None
balance: Optional[Decimal] = None
credit_limit: Optional[Decimal] = None
guid: Optional[str] = None
membership_state: Optional[MembershipState] = None
bookings_attended: Optional[int] = None
date_of_last_booking: Optional[datetime.datetime] = None
photo_modified_date: Optional[datetime.datetime] = None
created_date: Optional[datetime.datetime] = None
modified_date: Optional[datetime.datetime] = None
deleted_date: Optional[datetime.datetime] = None
member_key: Optional[str] = None
created_by_user_id: Optional[int] = None
assigned_to_user_id: Optional[int] = None
deleted_by_user_id: Optional[int] = None
gift_aid_permission: Optional[bool] = None
first_aid_permission: Optional[bool] = None
photo_permission: Optional[bool] = None
emergency_contact: Optional[str] = None
won_or_lost: Optional[int] = None
won_or_lost_date: Optional[datetime.datetime] = None
won_or_lost_by_user_id: Optional[int] = None
license_reference: Optional[str] = None
license_start_date: Optional[datetime.datetime] = None
license_renewal_date: Optional[datetime.datetime] = None
agreed_to_terms: Optional[datetime.datetime] = None
online_booking_banned: Optional[bool] = None
child_branch_id: Optional[int] = None
child_branch: Optional[str] = None
prospecting_points: Optional[int] = None
achievement_points: Optional[int] = None
parent_forenames: Optional[str] = None
parent_surname: Optional[str] = None
grading_readiness: Optional[int] = None
direct_debit_account_holder: Optional[str] = None
direct_debit_account_number: Optional[str] = None
direct_debit_sort_code: Optional[str] = None
direct_debit_bank_address: Optional[str] = None
invited_date: Optional[datetime.datetime] = None
grade: Optional[str] = None
colour_left: Optional[str] = None
colour_right: Optional[str] = None
sessions_to_complete: Optional[int] = None
unique_id: Optional[str] = None
preference_link: Optional[str] = None
marketing_all_link: Optional[str] = None
marketing_none_link: Optional[str] = None
app_registration_id: Optional[str] = None
app_registration_link: Optional[str] = None
app_qr_image_link: Optional[str] = None
card_number_qr_image_link: Optional[str] = None
photo_thumbnail_link: Optional[str] = None
content_types_opt_in: Optional[MessageTemplateContentType] = None
template_types_opt_in: Optional[MessageTemplateType] = None
can_email: Optional[bool] = None
can_direct_mail: Optional[bool] = None
can_s_m_s: Optional[bool] = None
can_telephone: Optional[bool] = None
no_marketing_consent: Optional[bool] = None
can_send_invite: Optional[bool] = None
branch_key: Optional[str] = None
sage_link: Optional[str] = None
sage_last_payment_date: Optional[datetime.datetime] = None
sage_first_payment_date: Optional[datetime.datetime] = None
sage_last_payment_amount: Optional[Decimal] = None
sage_first_payment_amount: Optional[Decimal] = None
sage_total_paid: Optional[Decimal] = None
Python MemberService.GetMemberByKeyRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/Member/GetMemberByKey HTTP/1.1
Host: api.clubmanagercentral.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
MemberKey: 00000000000000000000000000000000
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { MemberId: 0, BranchId: 0, MembershipNumber: String, JoinedDate: 0001-01-01, CardNumber: String, CompanyName: String, Gender: Unknown, GenderName: String, FullName: String, Title: String, Forenames: String, Surname: String, Address1: String, Address2: String, County: String, City: String, HomePhone: String, MobilePhone: String, EmailAddress: String, ExternalReference: String, Country: String, EmailOptOut: False, SmsOptOut: False, PhoneOptOut: False, LetterOptOut: False, UseExternalStatus: False, ExternalStatus: Off, DateOfBirth: 0001-01-01, Postcode: String, Notes: String, StartDate: 0001-01-01, Expires: 0001-01-01, SessionsRemaining: 0, ContractEndDate: 0001-01-01, DaysRemaining: 0, MembershipType: String, LastAttendance: 0001-01-01, Attendance: 0, MemberType: Prospect, RecurringPayments: 0, OverduePayments: 0, AttendanceThisWeek: 0, retentionMetric: 0, MonthlyAttendanceFrequency: 0, TotalProductSpend: 0, JournalEntry: String, Balance: 0, CreditLimit: 0, guid: 00000000000000000000000000000000, MembershipState: Prospect, BookingsAttended: 0, DateOfLastBooking: 0001-01-01, PhotoModifiedDate: 0001-01-01, CreatedDate: 0001-01-01, ModifiedDate: 0001-01-01, DeletedDate: 0001-01-01, MemberKey: 00000000000000000000000000000000, CreatedByUserId: 0, AssignedToUserId: 0, DeletedByUserId: 0, GiftAidPermission: False, FirstAidPermission: False, PhotoPermission: False, EmergencyContact: String, WonOrLost: 0, WonOrLostDate: 0001-01-01, WonOrLostByUserId: 0, LicenseReference: String, LicenseStartDate: 0001-01-01, LicenseRenewalDate: 0001-01-01, AgreedToTerms: 0001-01-01, OnlineBookingBanned: False, ChildBranchId: 0, ChildBranch: String, ProspectingPoints: 0, AchievementPoints: 0, ParentForenames: String, ParentSurname: String, GradingReadiness: 0, DirectDebitAccountHolder: String, DirectDebitAccountNumber: String, DirectDebitSortCode: String, DirectDebitBankAddress: String, InvitedDate: 0001-01-01, Grade: String, ColourLeft: String, ColourRight: String, SessionsToComplete: 0, UniqueId: 7UeZ5kavxWRMNAaGI7oAjUB5plObFmBIyBVQz1PT+gY=, PreferenceLink: "https://secure.clubmanagercentral.com/Portal/Login/Transfer?id=7UeZ5kavxWRMNAaGI7oAjUB5plObFmBIyBVQz1PT%2bgY%3d", MarketingAllLink: "https://secure.clubmanagercentral.com/Portal/Login/TransferOptInAll?id=7UeZ5kavxWRMNAaGI7oAjUB5plObFmBIyBVQz1PT%2bgY%3d", MarketingNoneLink: "https://secure.clubmanagercentral.com/Portal/Login/TransferOptOutAll?id=7UeZ5kavxWRMNAaGI7oAjUB5plObFmBIyBVQz1PT%2bgY%3d", AppRegistrationId: tdEETnrE2UDYoDHYyiFtLUFbiv0Psfko1F+WdmLSeeLOfNJrwIXoKym0RGXbqDsBIcwMpLHhEzKbJbIzcmw6pzckMg2FYdjFlmJyfSP0eLuds6cHc1S3fVarWefI9AR4o6h0SdkblsIhdsjELgqaKQ==, AppRegistrationLink: "https://secure.clubmanagercentral.com/Register?id=tdEETnrE2UDYoDHYyiFtLUFbiv0Psfko1F+WdmLSeeLOfNJrwIXoKym0RGXbqDsBIcwMpLHhEzKbJbIzcmw6pzckMg2FYdjFlmJyfSP0eLuds6cHc1S3fVarWefI9AR4o6h0SdkblsIhdsjELgqaKQ==", AppQrImageLink: "https://secure.clubmanagercentral.com/Member.mvc/GetQrByMemberId?id=36xZln01EfE80ZF7GFWKkg==", CardNumberQrImageLink: "https://secure.clubmanagercentral.com/Member.mvc/GetCardNumberQRByMemberId?id=36xZln01EfE80ZF7GFWKkg==", PhotoThumbnailLink: "https://secure.clubmanagercentral.com/Member.mvc/GetPhotoThumbnailByMemberId?id=36xZln01EfE80ZF7GFWKkg==", ContentTypesOptIn: 1, TemplateTypesOptIn: 1, CanEmail: False, CanDirectMail: False, CanSMS: True, CanTelephone: False, NoMarketingConsent: False, CanSendInvite: False, BranchKey: 00000000000000000000000000000000, SageLink: String, SageLastPaymentDate: 0001-01-01, SageFirstPaymentDate: 0001-01-01, SageLastPaymentAmount: 0, SageFirstPaymentAmount: 0, SageTotalPaid: 0 }