| POST | /v1/forms/{FormUID}/notices/preview |
|---|
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 FormInboxCount:
v: Optional[str] = None
l: Optional[str] = None
n: int = 0
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FormNoticePreviewResponse:
subject: Optional[str] = None
body: Optional[str] = None
meta: Optional[str] = None
submission_u_i_d: Optional[str] = None
sample: bool = False
sample_note: Optional[str] = None
text_length: int = 0
segments: int = 0
wide: bool = False
problems: List[str] = field(default_factory=list)
samples: List[FormInboxCount] = field(default_factory=list)
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FormNoticePreviewRequest:
form_u_i_d: Optional[str] = None
id: Optional[str] = None
lang: Optional[str] = None
channel: Optional[str] = None
subject: Optional[str] = None
body: Optional[str] = None
text: Optional[str] = None
closing: Optional[str] = None
submission_u_i_d: Optional[str] = None
Python FormNoticePreviewRequest 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/forms/{FormUID}/notices/preview HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
FormUID: 00000000000000000000000000000000,
Id: String,
Lang: String,
Channel: String,
Subject: String,
Body: String,
Text: String,
Closing: String,
SubmissionUID: 00000000000000000000000000000000
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Subject: String,
Body: String,
Meta: String,
SubmissionUID: String,
Sample: False,
SampleNote: String,
TextLength: 0,
Segments: 0,
Wide: False,
Problems:
[
String
],
Samples:
[
{
V: String,
L: String,
N: 0
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}