| POST | /v1/forms/{FormUID}/notices/preview |
|---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class FormInboxCount implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $V=null,
/** @var string|null */
public ?string $L=null,
/** @var int */
public int $N=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['V'])) $this->V = $o['V'];
if (isset($o['L'])) $this->L = $o['L'];
if (isset($o['N'])) $this->N = $o['N'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->V)) $o['V'] = $this->V;
if (isset($this->L)) $o['L'] = $this->L;
if (isset($this->N)) $o['N'] = $this->N;
return empty($o) ? new class(){} : $o;
}
}
class FormNoticePreviewResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Subject=null,
/** @var string|null */
public ?string $Body=null,
/** @var string|null */
public ?string $Meta=null,
/** @var string|null */
public ?string $SubmissionUID=null,
/** @var bool|null */
public ?bool $Sample=null,
/** @var string|null */
public ?string $SampleNote=null,
/** @var int */
public int $TextLength=0,
/** @var int */
public int $Segments=0,
/** @var bool|null */
public ?bool $Wide=null,
/** @var array<string>|null */
public ?array $Problems=null,
/** @var array<FormInboxCount>|null */
public ?array $Samples=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Subject'])) $this->Subject = $o['Subject'];
if (isset($o['Body'])) $this->Body = $o['Body'];
if (isset($o['Meta'])) $this->Meta = $o['Meta'];
if (isset($o['SubmissionUID'])) $this->SubmissionUID = $o['SubmissionUID'];
if (isset($o['Sample'])) $this->Sample = $o['Sample'];
if (isset($o['SampleNote'])) $this->SampleNote = $o['SampleNote'];
if (isset($o['TextLength'])) $this->TextLength = $o['TextLength'];
if (isset($o['Segments'])) $this->Segments = $o['Segments'];
if (isset($o['Wide'])) $this->Wide = $o['Wide'];
if (isset($o['Problems'])) $this->Problems = JsonConverters::fromArray('string', $o['Problems']);
if (isset($o['Samples'])) $this->Samples = JsonConverters::fromArray('FormInboxCount', $o['Samples']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Subject)) $o['Subject'] = $this->Subject;
if (isset($this->Body)) $o['Body'] = $this->Body;
if (isset($this->Meta)) $o['Meta'] = $this->Meta;
if (isset($this->SubmissionUID)) $o['SubmissionUID'] = $this->SubmissionUID;
if (isset($this->Sample)) $o['Sample'] = $this->Sample;
if (isset($this->SampleNote)) $o['SampleNote'] = $this->SampleNote;
if (isset($this->TextLength)) $o['TextLength'] = $this->TextLength;
if (isset($this->Segments)) $o['Segments'] = $this->Segments;
if (isset($this->Wide)) $o['Wide'] = $this->Wide;
if (isset($this->Problems)) $o['Problems'] = JsonConverters::toArray('string', $this->Problems);
if (isset($this->Samples)) $o['Samples'] = JsonConverters::toArray('FormInboxCount', $this->Samples);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class FormNoticePreviewRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $FormUID='',
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Lang=null,
/** @var string|null */
public ?string $Channel=null,
/** @var string|null */
public ?string $Subject=null,
/** @var string|null */
public ?string $Body=null,
/** @var string|null */
public ?string $Text=null,
/** @var string|null */
public ?string $Closing=null,
/** @var string|null */
public ?string $SubmissionUID=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Lang'])) $this->Lang = $o['Lang'];
if (isset($o['Channel'])) $this->Channel = $o['Channel'];
if (isset($o['Subject'])) $this->Subject = $o['Subject'];
if (isset($o['Body'])) $this->Body = $o['Body'];
if (isset($o['Text'])) $this->Text = $o['Text'];
if (isset($o['Closing'])) $this->Closing = $o['Closing'];
if (isset($o['SubmissionUID'])) $this->SubmissionUID = $o['SubmissionUID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Lang)) $o['Lang'] = $this->Lang;
if (isset($this->Channel)) $o['Channel'] = $this->Channel;
if (isset($this->Subject)) $o['Subject'] = $this->Subject;
if (isset($this->Body)) $o['Body'] = $this->Body;
if (isset($this->Text)) $o['Text'] = $this->Text;
if (isset($this->Closing)) $o['Closing'] = $this->Closing;
if (isset($this->SubmissionUID)) $o['SubmissionUID'] = $this->SubmissionUID;
return empty($o) ? new class(){} : $o;
}
}
PHP FormNoticePreviewRequest 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
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: application/json
Content-Type: application/json
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: application/json
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"}}}