| Requires any of the roles: | Worker, Agent, Administrator, Worker, Agent, Administrator, Worker, Agent, Administrator, Worker, Agent, Administrator |
| GET,POST,PUT,DELETE,OPTIONS | /v1/ContactHistory/{ContactHistoryId} | ||
|---|---|---|---|
| GET,POST,PUT,DELETE,OPTIONS | /v1/ContactHistory |
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 ContactHistory:
contact_history_id: int = 0
contact_id: int = 0
event_id: int = 0
agent_id: int = 0
event_date: datetime.datetime = datetime.datetime(1, 1, 1)
date_created: datetime.datetime = datetime.datetime(1, 1, 1)
note: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ActivityTracker_Application:
contact_name: Optional[str] = None
carriers: Optional[str] = None
application_id: int = 0
contact_id: int = 0
life_a_p: Decimal = decimal.Decimal(0)
annuity_flow: Decimal = decimal.Decimal(0)
annuity_transfer: Decimal = decimal.Decimal(0)
date_created: datetime.datetime = datetime.datetime(1, 1, 1)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ContactHistoryExtended(ContactHistory):
event_type_name: Optional[str] = None
application: List[ActivityTracker_Application] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ContactHistoryResponse:
response_status: Optional[ResponseStatus] = None
contact_history: List[ContactHistoryExtended] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ContactHistoryRequest:
contact_history: List[ContactHistory] = field(default_factory=list)
Python ContactHistoryRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/ContactHistory/{ContactHistoryId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ContactHistory":[{"ContactHistoryId":0,"ContactId":0,"EventId":0,"AgentId":0,"EventDate":"0001-01-01T00:00:00.0000000","DateCreated":"0001-01-01T00:00:00.0000000","Note":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"ContactHistory":[{"EventTypeName":"String","Application":[{"ContactName":"String","Carriers":"String","ApplicationId":0,"ContactId":0,"LifeAP":0,"AnnuityFlow":0,"AnnuityTransfer":0,"DateCreated":"0001-01-01T00:00:00.0000000"}],"ContactHistoryId":0,"ContactId":0,"EventId":0,"AgentId":0,"EventDate":"0001-01-01T00:00:00.0000000","DateCreated":"0001-01-01T00:00:00.0000000","Note":"String"}]}