Trendsic Platform Service

<back to all web services

FormContactPanelRequest

Requires Authentication
The following routes are available for this service:
GET/v1/forms/contacts/{ContactId}
<?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 FormContactPanelSub implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SubmissionUID=null,
        /** @var string|null */
        public ?string $Number=null,
        /** @var string|null */
        public ?string $FormName=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var string|null */
        public ?string $Tone=null,
        /** @var string|null */
        public ?string $SubmittedAt=null,
        /** @var string|null */
        public ?string $BranchName=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['SubmissionUID'])) $this->SubmissionUID = $o['SubmissionUID'];
        if (isset($o['Number'])) $this->Number = $o['Number'];
        if (isset($o['FormName'])) $this->FormName = $o['FormName'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['Tone'])) $this->Tone = $o['Tone'];
        if (isset($o['SubmittedAt'])) $this->SubmittedAt = $o['SubmittedAt'];
        if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->SubmissionUID)) $o['SubmissionUID'] = $this->SubmissionUID;
        if (isset($this->Number)) $o['Number'] = $this->Number;
        if (isset($this->FormName)) $o['FormName'] = $this->FormName;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->Tone)) $o['Tone'] = $this->Tone;
        if (isset($this->SubmittedAt)) $o['SubmittedAt'] = $this->SubmittedAt;
        if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
        return empty($o) ? new class(){} : $o;
    }
}

class FormOfficeDraftRow implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SubmissionUID=null,
        /** @var string|null */
        public ?string $FormUID=null,
        /** @var string|null */
        public ?string $FormName=null,
        /** @var string|null */
        public ?string $ForName=null,
        /** @var string|null */
        public ?string $BranchName=null,
        /** @var int|null */
        public ?int $ContactId=null,
        /** @var int */
        public int $Page=0,
        /** @var int */
        public int $Pages=0,
        /** @var string|null */
        public ?string $SavedBy=null,
        /** @var string|null */
        public ?string $SavedAt=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['SubmissionUID'])) $this->SubmissionUID = $o['SubmissionUID'];
        if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
        if (isset($o['FormName'])) $this->FormName = $o['FormName'];
        if (isset($o['ForName'])) $this->ForName = $o['ForName'];
        if (isset($o['BranchName'])) $this->BranchName = $o['BranchName'];
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['Page'])) $this->Page = $o['Page'];
        if (isset($o['Pages'])) $this->Pages = $o['Pages'];
        if (isset($o['SavedBy'])) $this->SavedBy = $o['SavedBy'];
        if (isset($o['SavedAt'])) $this->SavedAt = $o['SavedAt'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->SubmissionUID)) $o['SubmissionUID'] = $this->SubmissionUID;
        if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
        if (isset($this->FormName)) $o['FormName'] = $this->FormName;
        if (isset($this->ForName)) $o['ForName'] = $this->ForName;
        if (isset($this->BranchName)) $o['BranchName'] = $this->BranchName;
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->Page)) $o['Page'] = $this->Page;
        if (isset($this->Pages)) $o['Pages'] = $this->Pages;
        if (isset($this->SavedBy)) $o['SavedBy'] = $this->SavedBy;
        if (isset($this->SavedAt)) $o['SavedAt'] = $this->SavedAt;
        return empty($o) ? new class(){} : $o;
    }
}

class FormOfficeApp implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $FormUID=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Noun=null,
        /** @var string|null */
        public ?string $DefaultBranchId=null,
        /** @var bool|null */
        public ?bool $IsRecord=null,
        /** @var string|null */
        public ?string $RoleName=null
    ) {
    }

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

class FormContactPanelResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<FormContactPanelSub>|null */
        public ?array $Subs=null,
        /** @var array<FormOfficeDraftRow>|null */
        public ?array $Drafts=null,
        /** @var array<FormOfficeApp>|null */
        public ?array $Forms=null,
        /** @var bool|null */
        public ?bool $CanStart=null,
        /** @var string|null */
        public ?string $ContactName=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Subs'])) $this->Subs = JsonConverters::fromArray('FormContactPanelSub', $o['Subs']);
        if (isset($o['Drafts'])) $this->Drafts = JsonConverters::fromArray('FormOfficeDraftRow', $o['Drafts']);
        if (isset($o['Forms'])) $this->Forms = JsonConverters::fromArray('FormOfficeApp', $o['Forms']);
        if (isset($o['CanStart'])) $this->CanStart = $o['CanStart'];
        if (isset($o['ContactName'])) $this->ContactName = $o['ContactName'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Subs)) $o['Subs'] = JsonConverters::toArray('FormContactPanelSub', $this->Subs);
        if (isset($this->Drafts)) $o['Drafts'] = JsonConverters::toArray('FormOfficeDraftRow', $this->Drafts);
        if (isset($this->Forms)) $o['Forms'] = JsonConverters::toArray('FormOfficeApp', $this->Forms);
        if (isset($this->CanStart)) $o['CanStart'] = $this->CanStart;
        if (isset($this->ContactName)) $o['ContactName'] = $this->ContactName;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class FormContactPanelRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0
    ) {
    }

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

PHP FormContactPanelRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/forms/contacts/{ContactId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Subs":[{"SubmissionUID":"String","Number":"String","FormName":"String","Stage":"String","Tone":"String","SubmittedAt":"String","BranchName":"String"}],"Drafts":[{"SubmissionUID":"String","FormUID":"String","FormName":"String","ForName":"String","BranchName":"String","ContactId":0,"Page":0,"Pages":0,"SavedBy":"String","SavedAt":"String"}],"Forms":[{"FormUID":"String","Name":"String","Noun":"String","DefaultBranchId":"String","IsRecord":false,"RoleName":"String"}],"CanStart":false,"ContactName":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}