Trendsic Platform Service

<back to all web services

FormSubmissionRequestPreviewRequest

Requires Authentication
The following routes are available for this service:
POST/v1/forms/submissions/{SubmissionUID}/request-info/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 FormRequestItem implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $K=null,
        /** @var string|null */
        public ?string $L=null,
        /** @var string|null */
        public ?string $Tag=null,
        /** @var string|null */
        public ?string $Tone=null,
        /** @var bool|null */
        public ?bool $Pre=null,
        /** @var bool|null */
        public ?bool $IsSignature=null,
        /** @var bool|null */
        public ?bool $IsSensitive=null,
        /** @var int */
        public int $Pi=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['K'])) $this->K = $o['K'];
        if (isset($o['L'])) $this->L = $o['L'];
        if (isset($o['Tag'])) $this->Tag = $o['Tag'];
        if (isset($o['Tone'])) $this->Tone = $o['Tone'];
        if (isset($o['Pre'])) $this->Pre = $o['Pre'];
        if (isset($o['IsSignature'])) $this->IsSignature = $o['IsSignature'];
        if (isset($o['IsSensitive'])) $this->IsSensitive = $o['IsSensitive'];
        if (isset($o['Pi'])) $this->Pi = $o['Pi'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->K)) $o['K'] = $this->K;
        if (isset($this->L)) $o['L'] = $this->L;
        if (isset($this->Tag)) $o['Tag'] = $this->Tag;
        if (isset($this->Tone)) $o['Tone'] = $this->Tone;
        if (isset($this->Pre)) $o['Pre'] = $this->Pre;
        if (isset($this->IsSignature)) $o['IsSignature'] = $this->IsSignature;
        if (isset($this->IsSensitive)) $o['IsSensitive'] = $this->IsSensitive;
        if (isset($this->Pi)) $o['Pi'] = $this->Pi;
        return empty($o) ? new class(){} : $o;
    }
}

class FormRequestPlan implements JsonSerializable
{
    public function __construct(
        /** @var array<FormRequestItem>|null */
        public ?array $Items=null,
        /** @var array<string>|null */
        public ?array $Keys=null,
        /** @var array<string>|null */
        public ?array $Resign=null,
        /** @var array<string>|null */
        public ?array $ResignKeys=null,
        /** @var string|null */
        public ?string $Channels=null,
        /** @var string|null */
        public ?string $StageLabel=null,
        /** @var string|null */
        public ?string $Consequence=null,
        /** @var string|null */
        public ?string $Applicant=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var bool|null */
        public ?bool $CanSend=null,
        /** @var string|null */
        public ?string $Refusal=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('FormRequestItem', $o['Items']);
        if (isset($o['Keys'])) $this->Keys = JsonConverters::fromArray('string', $o['Keys']);
        if (isset($o['Resign'])) $this->Resign = JsonConverters::fromArray('string', $o['Resign']);
        if (isset($o['ResignKeys'])) $this->ResignKeys = JsonConverters::fromArray('string', $o['ResignKeys']);
        if (isset($o['Channels'])) $this->Channels = $o['Channels'];
        if (isset($o['StageLabel'])) $this->StageLabel = $o['StageLabel'];
        if (isset($o['Consequence'])) $this->Consequence = $o['Consequence'];
        if (isset($o['Applicant'])) $this->Applicant = $o['Applicant'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['CanSend'])) $this->CanSend = $o['CanSend'];
        if (isset($o['Refusal'])) $this->Refusal = $o['Refusal'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('FormRequestItem', $this->Items);
        if (isset($this->Keys)) $o['Keys'] = JsonConverters::toArray('string', $this->Keys);
        if (isset($this->Resign)) $o['Resign'] = JsonConverters::toArray('string', $this->Resign);
        if (isset($this->ResignKeys)) $o['ResignKeys'] = JsonConverters::toArray('string', $this->ResignKeys);
        if (isset($this->Channels)) $o['Channels'] = $this->Channels;
        if (isset($this->StageLabel)) $o['StageLabel'] = $this->StageLabel;
        if (isset($this->Consequence)) $o['Consequence'] = $this->Consequence;
        if (isset($this->Applicant)) $o['Applicant'] = $this->Applicant;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->CanSend)) $o['CanSend'] = $this->CanSend;
        if (isset($this->Refusal)) $o['Refusal'] = $this->Refusal;
        return empty($o) ? new class(){} : $o;
    }
}

class FormSubmissionRequestPreviewResponse implements JsonSerializable
{
    public function __construct(
        /** @var FormRequestPlan|null */
        public ?FormRequestPlan $Plan=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Plan'])) $this->Plan = JsonConverters::from('FormRequestPlan', $o['Plan']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Plan)) $o['Plan'] = JsonConverters::to('FormRequestPlan', $this->Plan);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class FormSubmissionRequestPreviewRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $SubmissionUID='',
        /** @var array<string>|null */
        public ?array $Keys=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['SubmissionUID'])) $this->SubmissionUID = $o['SubmissionUID'];
        if (isset($o['Keys'])) $this->Keys = JsonConverters::fromArray('string', $o['Keys']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->SubmissionUID)) $o['SubmissionUID'] = $this->SubmissionUID;
        if (isset($this->Keys)) $o['Keys'] = JsonConverters::toArray('string', $this->Keys);
        return empty($o) ? new class(){} : $o;
    }
}

PHP FormSubmissionRequestPreviewRequest 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/submissions/{SubmissionUID}/request-info/preview HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<FormSubmissionRequestPreviewRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Keys xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Keys>
  <SubmissionUID>00000000-0000-0000-0000-000000000000</SubmissionUID>
</FormSubmissionRequestPreviewRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FormSubmissionRequestPreviewResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Plan>
    <Applicant>String</Applicant>
    <CanSend>false</CanSend>
    <Channels>String</Channels>
    <Consequence>String</Consequence>
    <Items>
      <FormRequestItem>
        <IsSensitive>false</IsSensitive>
        <IsSignature>false</IsSignature>
        <K>String</K>
        <L>String</L>
        <Pi>0</Pi>
        <Pre>false</Pre>
        <Tag>String</Tag>
        <Tone>String</Tone>
      </FormRequestItem>
    </Items>
    <Keys xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Keys>
    <Refusal>String</Refusal>
    <Resign xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Resign>
    <ResignKeys xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </ResignKeys>
    <Stage>String</Stage>
    <StageLabel>String</StageLabel>
  </Plan>
  <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>
</FormSubmissionRequestPreviewResponse>