Trendsic Platform Service

<back to all web services

FormNoticePreviewRequest

Requires Authentication
The following routes are available for this service:
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 .xml suffix or ?format=xml

HTTP + XML

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/xml
Content-Type: application/xml
Content-Length: length

<FormNoticePreviewRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Body>String</Body>
  <Channel>String</Channel>
  <Closing>String</Closing>
  <FormUID>00000000-0000-0000-0000-000000000000</FormUID>
  <Id>String</Id>
  <Lang>String</Lang>
  <Subject>String</Subject>
  <SubmissionUID>00000000-0000-0000-0000-000000000000</SubmissionUID>
  <Text>String</Text>
</FormNoticePreviewRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FormNoticePreviewResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Body>String</Body>
  <Meta>String</Meta>
  <Problems xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Problems>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Sample>false</Sample>
  <SampleNote>String</SampleNote>
  <Samples>
    <FormInboxCount>
      <L>String</L>
      <N>0</N>
      <V>String</V>
    </FormInboxCount>
  </Samples>
  <Segments>0</Segments>
  <Subject>String</Subject>
  <SubmissionUID>String</SubmissionUID>
  <TextLength>0</TextLength>
  <Wide>false</Wide>
</FormNoticePreviewResponse>