| POST,OPTIONS | /v1/conversation/crm/reply |
|---|
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 TwilioRequest:
account_sid: Optional[str] = None
from_: Optional[str] = field(metadata=config(field_name='from'), default=None)
to: Optional[str] = None
from_city: Optional[str] = None
from_state: Optional[str] = None
from_zip: Optional[str] = None
from_country: Optional[str] = None
to_city: Optional[str] = None
to_state: Optional[str] = None
to_zip: Optional[str] = None
to_country: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SmsRequest(TwilioRequest):
message_sid: Optional[str] = None
sms_sid: Optional[str] = None
body: Optional[str] = None
message_status: Optional[str] = None
opt_out_type: Optional[str] = None
messaging_service_sid: Optional[str] = None
num_media: int = 0
referral_num_media: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class IncomingCRMConversationRequest(SmsRequest):
pass
Python IncomingCRMConversationRequest 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 /v1/conversation/crm/reply HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
MessageSid: String,
SmsSid: String,
Body: String,
MessageStatus: String,
OptOutType: String,
MessagingServiceSid: String,
NumMedia: 0,
ReferralNumMedia: 0,
AccountSid: String,
From: String,
To: String,
FromCity: String,
FromState: String,
FromZip: String,
FromCountry: String,
ToCity: String,
ToState: String,
ToZip: String,
ToCountry: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length (string)