POST, GET | /api/SearchContactManagement |
---|
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 BaseRequest:
# @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
api_key: Optional[str] = None
"""
This is your AIM API Key provided by Tri-Tech
"""
# @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
o_auth_token: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseSecureRequest(BaseRequest):
# @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header")
token: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header")
device_id: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header")
app_id: Optional[str] = None
"""
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseResponseResult:
# @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
status_code: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
login: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
error_code: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
error_display_text: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
error_message: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
domain_name: Optional[str] = None
"""
"""
# @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
ip_address: Optional[str] = None
"""
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseResponse:
# @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
status: Optional[BaseResponseResult] = None
"""
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AttributeValuePair:
name: Optional[str] = None
value: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ContactManagementRecord:
ref: Optional[str] = None
date_time: datetime.datetime = datetime.datetime(1, 1, 1)
contact: Optional[str] = None
cus_acct: int = 0
action_id: int = 0
status: Optional[str] = None
action_date: Optional[datetime.datetime] = None
pop_up: bool = False
topic_id: Optional[int] = None
topic: Optional[str] = None
closed: bool = False
closed_date: Optional[datetime.datetime] = None
color_value: int = 0
lan_id: Optional[str] = None
formatted_notes: bool = False
note1: Optional[str] = None
note2: Optional[str] = None
note3: Optional[str] = None
attributes: Optional[List[AttributeValuePair]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchContactManagementResponse(BaseResponse):
contact_management_records: Optional[List[ContactManagementRecord]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchContactManagementRequest(BaseSecureRequest):
"""
SearchContactManagement web service.
"""
formatted_notes: Optional[bool] = None
# @ApiMember(DataType="string", Description="If sent, all other search parameters will be ignored.", Name="Ref", ParameterType="query")
ref: Optional[str] = None
"""
If sent, all other search parameters will be ignored.
"""
acct: Optional[int] = None
date_from: Optional[datetime.datetime] = None
date_to: Optional[datetime.datetime] = None
include_closed: Optional[bool] = None
# @ApiMember(DataType="string", Description="", Name="SearchString", ParameterType="query")
search_string: Optional[str] = None
"""
"""
action_id: Optional[int] = None
Python SearchContactManagementRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/SearchContactManagement HTTP/1.1
Host: active-ewebservice.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SearchContactManagementRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<ApiKey>String</ApiKey>
<OAuthToken>String</OAuthToken>
<AppId>String</AppId>
<DeviceId>String</DeviceId>
<Token>String</Token>
<Acct>0</Acct>
<ActionId>0</ActionId>
<DateFrom>0001-01-01T00:00:00</DateFrom>
<DateTo>0001-01-01T00:00:00</DateTo>
<FormattedNotes>false</FormattedNotes>
<IncludeClosed>false</IncludeClosed>
<Ref>String</Ref>
<SearchString>String</SearchString>
</SearchContactManagementRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SearchContactManagementResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService"> <Status> <DomainName>String</DomainName> <ErrorCode>String</ErrorCode> <ErrorDisplayText>String</ErrorDisplayText> <ErrorMessage>String</ErrorMessage> <IpAddress>String</IpAddress> <Login>String</Login> <StatusCode>String</StatusCode> </Status> <ContactManagementRecords xmlns:d2p1="http://schemas.datacontract.org/2004/07/AIM"> <d2p1:ContactManagementRecord> <d2p1:ActionDate>0001-01-01T00:00:00</d2p1:ActionDate> <d2p1:ActionId>0</d2p1:ActionId> <d2p1:Attributes> <d2p1:AttributeValuePair> <d2p1:Name>String</d2p1:Name> <d2p1:Value>String</d2p1:Value> </d2p1:AttributeValuePair> </d2p1:Attributes> <d2p1:Closed>false</d2p1:Closed> <d2p1:ClosedDate>0001-01-01T00:00:00</d2p1:ClosedDate> <d2p1:ColorValue>0</d2p1:ColorValue> <d2p1:Contact>String</d2p1:Contact> <d2p1:CusAcct>0</d2p1:CusAcct> <d2p1:DateTime>0001-01-01T00:00:00</d2p1:DateTime> <d2p1:FormattedNotes>false</d2p1:FormattedNotes> <d2p1:LanId>String</d2p1:LanId> <d2p1:Note1>String</d2p1:Note1> <d2p1:Note2>String</d2p1:Note2> <d2p1:Note3>String</d2p1:Note3> <d2p1:PopUp>false</d2p1:PopUp> <d2p1:Ref>String</d2p1:Ref> <d2p1:Status>String</d2p1:Status> <d2p1:Topic>String</d2p1:Topic> <d2p1:TopicId>0</d2p1:TopicId> </d2p1:ContactManagementRecord> </ContactManagementRecords> </SearchContactManagementResponse>