ClubManager.Api

<back to all web services

FindJournal

Requires Authentication
Required role:API
The following routes are available for this service:
All Verbs/api/Query/Journal
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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MessageTemplateInstance:
    message_template_id: Optional[int] = None
    name: Optional[str] = None
    subject: Optional[str] = None
    body: Optional[str] = None
    report_id: Optional[int] = None
    template_type: Optional[int] = None
    created: Optional[datetime.datetime] = None
    created_by: Optional[int] = None
    modified: Optional[datetime.datetime] = None
    modified_by: Optional[int] = None
    deleted: Optional[datetime.datetime] = None
    deleted_by: Optional[int] = None
    event_type: Optional[int] = None
    content_type: Optional[int] = None
    hidden: Optional[bool] = None
    parent_message_template_id: Optional[int] = None
    inclusion_tags: Optional[str] = None
    exclusion_tags: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MessageInstance:
    message_id: Optional[int] = None
    due_date: Optional[datetime.datetime] = None
    sent_date: Optional[datetime.datetime] = None
    processed: Optional[bool] = None
    failures: Optional[int] = None
    instance_id: Optional[int] = None
    message_sid: Optional[str] = None
    message_template: Optional[MessageTemplateInstance] = None
    # @References(typeof(MessageTemplateInstance))
    message_template_id: Optional[int] = None

    opened_date: Optional[datetime.datetime] = None
    bounced_date: Optional[datetime.datetime] = None
    delivered_date: Optional[datetime.datetime] = None
    unsubscribed_date: Optional[datetime.datetime] = None
    spam_report_date: Optional[datetime.datetime] = None
    user: Optional[UserInstance] = None
    # @References(typeof(UserInstance))
    user_id: Optional[int] = None

    instance_type: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JournalInstance:
    journal_id: Optional[int] = None
    journal_date: Optional[datetime.datetime] = None
    title: Optional[str] = None
    comment: Optional[str] = None
    message_type: Optional[int] = None
    user_name: Optional[str] = None
    member: Optional[MemberInstance] = None
    # @References(typeof(MemberInstance))
    member_id: Optional[int] = None

    message: Optional[MessageInstance] = None
    # @References(typeof(MessageInstance))
    message_id: Optional[int] = None

    viewed_date: Optional[datetime.datetime] = None
    deleted: Optional[bool] = None
    demo: Optional[bool] = None
    permanent: Optional[bool] = None
    alert_date: Optional[datetime.datetime] = None
    assigned_to_user_id: Optional[int] = None
    completed: Optional[bool] = None
    completed_date: Optional[datetime.datetime] = None
    created_by_user_id: Optional[int] = None
    postponed_count: Optional[int] = None
    send_s_m_s_reminder: Optional[bool] = None
    no_show: Optional[bool] = None


# @AutoQueryViewer(Description="", IconUrl="octicon:database", Title="Journal")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FindJournal(QueryDb[JournalInstance]):
    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 FindJournal DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /api/Query/Journal HTTP/1.1 
Host: api.clubmanagercentral.com 
Accept: application/json
Content-Type: application/json
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: application/json
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"JournalId":0,"JournalDate":"0001-01-01T00:00:00.0000000","Title":"String","Comment":"String","MessageType":0,"UserName":"String","Member":{"MemberId":0,"MemberType":0,"MembershipNumber":"String","CardNumber":"String","CompanyName":"String","Surname":"String","Forenames":"String","Title":"String","Gender":0,"DateOfBirth":"0001-01-01T00:00:00.0000000","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-01T00:00:00.0000000","DirectDebitBankAddress":"String","FullName":"String","ExternalReference":"String","Photo":"AA==","PhotoModifiedDate":"0001-01-01T00:00:00.0000000","Notes":"String","Deleted":false,"Demo":false,"UseExternalStatus":false,"ExternalStatus":0,"FreeText":"String","MemberKey":"00000000000000000000000000000000","Balance":0,"CreditLimit":0,"CreatedDate":"0001-01-01T00:00:00.0000000","ModifiedDate":"0001-01-01T00:00:00.0000000","DeletedDate":"0001-01-01T00:00:00.0000000","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-01T00:00:00.0000000","GiftAidPermission":false,"PhotoPermission":false,"FirstAidPermission":false,"EmergencyContact":"String","WonOrLostByUser":{"UserId":0,"UserName":"String","Name":"String","Email":"String","MobilePhone":"String","Enabled":false,"LastLogin":"0001-01-01T00:00:00.0000000","Created":"0001-01-01T00:00:00.0000000","Training":false,"Deleted":false,"CoursesCompleted":0,"DisplayHomeNotification":false,"TwoFactorEnabled":false,"EmailConfirmed":false,"MobilePhoneConfirmed":false,"Notifications":false,"ChangePassword":"0001-01-01T00:00:00.0000000","Activated":"0001-01-01T00:00:00.0000000"},"WonOrLostByUserId":0,"AgreedToTerms":"0001-01-01T00:00:00.0000000","OnlineBookingBanned":false,"Country":"String","FingerprintEnrolled":"0001-01-01T00:00:00.0000000","LastPaymentAmount":0,"Pin":"String","ProspectingPoints":0,"AchievementPoints":0,"ParentForenames":"String","ParentSurname":"String"},"MemberId":0,"Message":{"MessageId":0,"DueDate":"0001-01-01T00:00:00.0000000","SentDate":"0001-01-01T00:00:00.0000000","Processed":false,"Failures":0,"InstanceId":0,"MessageSid":"String","MessageTemplate":{"MessageTemplateId":0,"Name":"String","Subject":"String","Body":"String","ReportId":0,"TemplateType":0,"Created":"0001-01-01T00:00:00.0000000","CreatedBy":0,"Modified":"0001-01-01T00:00:00.0000000","ModifiedBy":0,"Deleted":"0001-01-01T00:00:00.0000000","DeletedBy":0,"EventType":0,"ContentType":0,"Hidden":false,"ParentMessageTemplateId":0,"InclusionTags":"String","ExclusionTags":"String"},"MessageTemplateId":0,"OpenedDate":"0001-01-01T00:00:00.0000000","BouncedDate":"0001-01-01T00:00:00.0000000","DeliveredDate":"0001-01-01T00:00:00.0000000","UnsubscribedDate":"0001-01-01T00:00:00.0000000","SpamReportDate":"0001-01-01T00:00:00.0000000","User":{"UserId":0,"UserName":"String","Name":"String","Email":"String","MobilePhone":"String","Enabled":false,"LastLogin":"0001-01-01T00:00:00.0000000","Created":"0001-01-01T00:00:00.0000000","Training":false,"Deleted":false,"CoursesCompleted":0,"DisplayHomeNotification":false,"TwoFactorEnabled":false,"EmailConfirmed":false,"MobilePhoneConfirmed":false,"Notifications":false,"ChangePassword":"0001-01-01T00:00:00.0000000","Activated":"0001-01-01T00:00:00.0000000"},"UserId":0,"InstanceType":0},"MessageId":0,"ViewedDate":"0001-01-01T00:00:00.0000000","Deleted":false,"Demo":false,"Permanent":false,"alertDate":"0001-01-01T00:00:00.0000000","AssignedToUserId":0,"Completed":false,"CompletedDate":"0001-01-01T00:00:00.0000000","CreatedByUserId":0,"PostponedCount":0,"SendSMSReminder":false,"NoShow":false}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}