Trendsic Platform Service

<back to all web services

FormFillReplyRequest

The following routes are available for this service:
POST/v1/formfill/status/{Token}/request/send
<?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 FormFillStage implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Tone=null,
        /** @var string|null */
        public ?string $Kind=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Label'])) $this->Label = $o['Label'];
        if (isset($o['Tone'])) $this->Tone = $o['Tone'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Label)) $o['Label'] = $this->Label;
        if (isset($this->Tone)) $o['Tone'] = $this->Tone;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        return empty($o) ? new class(){} : $o;
    }
}

class FormFillStageSeen implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var DateTime */
        public DateTime $At=new DateTime()
    ) {
    }

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

class FormFillReceiptLine implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Channel=null,
        /** @var string|null */
        public ?string $To=null,
        /** @var string|null */
        public ?string $Outcome=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Channel'])) $this->Channel = $o['Channel'];
        if (isset($o['To'])) $this->To = $o['To'];
        if (isset($o['Outcome'])) $this->Outcome = $o['Outcome'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Channel)) $o['Channel'] = $this->Channel;
        if (isset($this->To)) $o['To'] = $this->To;
        if (isset($this->Outcome)) $o['Outcome'] = $this->Outcome;
        return empty($o) ? new class(){} : $o;
    }
}

class FormFillStatusResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Number=null,
        /** @var string|null */
        public ?string $FormName=null,
        /** @var string|null */
        public ?string $Noun=null,
        /** @var string|null */
        public ?string $TenantName=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var string|null */
        public ?string $StageKind=null,
        /** @var array<FormFillStage>|null */
        public ?array $Stages=null,
        /** @var array<FormFillStageSeen>|null */
        public ?array $Seen=null,
        /** @var DateTime|null */
        public ?DateTime $SubmittedAt=null,
        /** @var array<FormFillReceiptLine>|null */
        public ?array $Receipt=null,
        /** @var bool|null */
        public ?bool $CanWithdraw=null,
        /** @var string|null */
        public ?string $Lang=null,
        /** @var string|null */
        public ?string $NounEs=null,
        /** @var bool|null */
        public ?bool $HasRequest=null,
        /** @var string|null */
        public ?string $RequestNote=null,
        /** @var string|null */
        public ?string $Outcome=null,
        /** @var string|null */
        public ?string $DecisionReason=null,
        /** @var string|null */
        public ?string $DecisionNote=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Number'])) $this->Number = $o['Number'];
        if (isset($o['FormName'])) $this->FormName = $o['FormName'];
        if (isset($o['Noun'])) $this->Noun = $o['Noun'];
        if (isset($o['TenantName'])) $this->TenantName = $o['TenantName'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['StageKind'])) $this->StageKind = $o['StageKind'];
        if (isset($o['Stages'])) $this->Stages = JsonConverters::fromArray('FormFillStage', $o['Stages']);
        if (isset($o['Seen'])) $this->Seen = JsonConverters::fromArray('FormFillStageSeen', $o['Seen']);
        if (isset($o['SubmittedAt'])) $this->SubmittedAt = JsonConverters::from('DateTime', $o['SubmittedAt']);
        if (isset($o['Receipt'])) $this->Receipt = JsonConverters::fromArray('FormFillReceiptLine', $o['Receipt']);
        if (isset($o['CanWithdraw'])) $this->CanWithdraw = $o['CanWithdraw'];
        if (isset($o['Lang'])) $this->Lang = $o['Lang'];
        if (isset($o['NounEs'])) $this->NounEs = $o['NounEs'];
        if (isset($o['HasRequest'])) $this->HasRequest = $o['HasRequest'];
        if (isset($o['RequestNote'])) $this->RequestNote = $o['RequestNote'];
        if (isset($o['Outcome'])) $this->Outcome = $o['Outcome'];
        if (isset($o['DecisionReason'])) $this->DecisionReason = $o['DecisionReason'];
        if (isset($o['DecisionNote'])) $this->DecisionNote = $o['DecisionNote'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Number)) $o['Number'] = $this->Number;
        if (isset($this->FormName)) $o['FormName'] = $this->FormName;
        if (isset($this->Noun)) $o['Noun'] = $this->Noun;
        if (isset($this->TenantName)) $o['TenantName'] = $this->TenantName;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->StageKind)) $o['StageKind'] = $this->StageKind;
        if (isset($this->Stages)) $o['Stages'] = JsonConverters::toArray('FormFillStage', $this->Stages);
        if (isset($this->Seen)) $o['Seen'] = JsonConverters::toArray('FormFillStageSeen', $this->Seen);
        if (isset($this->SubmittedAt)) $o['SubmittedAt'] = JsonConverters::to('DateTime', $this->SubmittedAt);
        if (isset($this->Receipt)) $o['Receipt'] = JsonConverters::toArray('FormFillReceiptLine', $this->Receipt);
        if (isset($this->CanWithdraw)) $o['CanWithdraw'] = $this->CanWithdraw;
        if (isset($this->Lang)) $o['Lang'] = $this->Lang;
        if (isset($this->NounEs)) $o['NounEs'] = $this->NounEs;
        if (isset($this->HasRequest)) $o['HasRequest'] = $this->HasRequest;
        if (isset($this->RequestNote)) $o['RequestNote'] = $this->RequestNote;
        if (isset($this->Outcome)) $o['Outcome'] = $this->Outcome;
        if (isset($this->DecisionReason)) $o['DecisionReason'] = $this->DecisionReason;
        if (isset($this->DecisionNote)) $o['DecisionNote'] = $this->DecisionNote;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class FormFillFieldError implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $K=null,
        /** @var string|null */
        public ?string $Msg=null
    ) {
    }

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

class FormFillReplyResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Sent=null,
        /** @var FormFillStatusResponse|null */
        public ?FormFillStatusResponse $Status=null,
        /** @var array<FormFillFieldError>|null */
        public ?array $Errors=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

class FormFillReplyRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Token=null,
        /** @var string|null */
        public ?string $RequestUID=null,
        /** @var string|null */
        public ?string $AnswersJson=null,
        /** @var string|null */
        public ?string $Lang=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Token'])) $this->Token = $o['Token'];
        if (isset($o['RequestUID'])) $this->RequestUID = $o['RequestUID'];
        if (isset($o['AnswersJson'])) $this->AnswersJson = $o['AnswersJson'];
        if (isset($o['Lang'])) $this->Lang = $o['Lang'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Token)) $o['Token'] = $this->Token;
        if (isset($this->RequestUID)) $o['RequestUID'] = $this->RequestUID;
        if (isset($this->AnswersJson)) $o['AnswersJson'] = $this->AnswersJson;
        if (isset($this->Lang)) $o['Lang'] = $this->Lang;
        return empty($o) ? new class(){} : $o;
    }
}

PHP FormFillReplyRequest 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/formfill/status/{Token}/request/send HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<FormFillReplyRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AnswersJson>String</AnswersJson>
  <Lang>String</Lang>
  <RequestUID>String</RequestUID>
  <Token>String</Token>
</FormFillReplyRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FormFillReplyResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Errors>
    <FormFillFieldError>
      <K>String</K>
      <Msg>String</Msg>
    </FormFillFieldError>
  </Errors>
  <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>
  <Sent>false</Sent>
  <Status>
    <CanWithdraw>false</CanWithdraw>
    <DecisionNote>String</DecisionNote>
    <DecisionReason>String</DecisionReason>
    <FormName>String</FormName>
    <HasRequest>false</HasRequest>
    <Lang>String</Lang>
    <Noun>String</Noun>
    <NounEs>String</NounEs>
    <Number>String</Number>
    <Outcome>String</Outcome>
    <Receipt>
      <FormFillReceiptLine>
        <Channel>String</Channel>
        <Outcome>String</Outcome>
        <To>String</To>
      </FormFillReceiptLine>
    </Receipt>
    <RequestNote>String</RequestNote>
    <ResponseStatus xmlns:d3p1="http://schemas.servicestack.net/types">
      <d3p1:ErrorCode>String</d3p1:ErrorCode>
      <d3p1:Message>String</d3p1:Message>
      <d3p1:StackTrace>String</d3p1:StackTrace>
      <d3p1:Errors>
        <d3p1:ResponseError>
          <d3p1:ErrorCode>String</d3p1:ErrorCode>
          <d3p1:FieldName>String</d3p1:FieldName>
          <d3p1:Message>String</d3p1:Message>
          <d3p1:Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </d3p1:Meta>
        </d3p1:ResponseError>
      </d3p1:Errors>
      <d3p1:Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d3p1:Meta>
    </ResponseStatus>
    <Seen>
      <FormFillStageSeen>
        <At>0001-01-01T00:00:00</At>
        <Id>String</Id>
      </FormFillStageSeen>
    </Seen>
    <Stage>String</Stage>
    <StageKind>String</StageKind>
    <Stages>
      <FormFillStage>
        <Id>String</Id>
        <Kind>String</Kind>
        <Label>String</Label>
        <Tone>String</Tone>
      </FormFillStage>
    </Stages>
    <SubmittedAt>0001-01-01T00:00:00</SubmittedAt>
    <TenantName>String</TenantName>
  </Status>
</FormFillReplyResponse>