Trendsic Platform Service

<back to all web services

FormZipPreviewRequest

Requires Authentication
The following routes are available for this service:
POST/v1/forms/submissions/zip/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 FormZipJobView implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ZipUID='',
        /** @var string */
        public string $FormUID='',
        /** @var string|null */
        public ?string $FormName=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $StatusText=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string|null */
        public ?string $FileName=null,
        /** @var int */
        public int $Submissions=0,
        /** @var int */
        public int $Files=0,
        /** @var int */
        public int $Bytes=0,
        /** @var int */
        public int $LeftOut=0,
        /** @var int|null */
        public ?int $FilesIn=null,
        /** @var int|null */
        public ?int $BytesIn=null,
        /** @var int|null */
        public ?int $LeftOutIn=null,
        /** @var int|null */
        public ?int $ZipBytes=null,
        /** @var string|null */
        public ?string $SizeText=null,
        /** @var DateTime|null */
        public ?DateTime $CreatedAt=null,
        /** @var string|null */
        public ?string $CreatedText=null,
        /** @var DateTime|null */
        public ?DateTime $CompletedAt=null,
        /** @var DateTime|null */
        public ?DateTime $ExpiresAt=null,
        /** @var string|null */
        public ?string $ExpiresText=null,
        /** @var int */
        public int $Downloads=0,
        /** @var string|null */
        public ?string $LastDownloadText=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ZipUID'])) $this->ZipUID = $o['ZipUID'];
        if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
        if (isset($o['FormName'])) $this->FormName = $o['FormName'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['StatusText'])) $this->StatusText = $o['StatusText'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['FileName'])) $this->FileName = $o['FileName'];
        if (isset($o['Submissions'])) $this->Submissions = $o['Submissions'];
        if (isset($o['Files'])) $this->Files = $o['Files'];
        if (isset($o['Bytes'])) $this->Bytes = $o['Bytes'];
        if (isset($o['LeftOut'])) $this->LeftOut = $o['LeftOut'];
        if (isset($o['FilesIn'])) $this->FilesIn = $o['FilesIn'];
        if (isset($o['BytesIn'])) $this->BytesIn = $o['BytesIn'];
        if (isset($o['LeftOutIn'])) $this->LeftOutIn = $o['LeftOutIn'];
        if (isset($o['ZipBytes'])) $this->ZipBytes = $o['ZipBytes'];
        if (isset($o['SizeText'])) $this->SizeText = $o['SizeText'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
        if (isset($o['CreatedText'])) $this->CreatedText = $o['CreatedText'];
        if (isset($o['CompletedAt'])) $this->CompletedAt = JsonConverters::from('DateTime', $o['CompletedAt']);
        if (isset($o['ExpiresAt'])) $this->ExpiresAt = JsonConverters::from('DateTime', $o['ExpiresAt']);
        if (isset($o['ExpiresText'])) $this->ExpiresText = $o['ExpiresText'];
        if (isset($o['Downloads'])) $this->Downloads = $o['Downloads'];
        if (isset($o['LastDownloadText'])) $this->LastDownloadText = $o['LastDownloadText'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ZipUID)) $o['ZipUID'] = $this->ZipUID;
        if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
        if (isset($this->FormName)) $o['FormName'] = $this->FormName;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->StatusText)) $o['StatusText'] = $this->StatusText;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->FileName)) $o['FileName'] = $this->FileName;
        if (isset($this->Submissions)) $o['Submissions'] = $this->Submissions;
        if (isset($this->Files)) $o['Files'] = $this->Files;
        if (isset($this->Bytes)) $o['Bytes'] = $this->Bytes;
        if (isset($this->LeftOut)) $o['LeftOut'] = $this->LeftOut;
        if (isset($this->FilesIn)) $o['FilesIn'] = $this->FilesIn;
        if (isset($this->BytesIn)) $o['BytesIn'] = $this->BytesIn;
        if (isset($this->LeftOutIn)) $o['LeftOutIn'] = $this->LeftOutIn;
        if (isset($this->ZipBytes)) $o['ZipBytes'] = $this->ZipBytes;
        if (isset($this->SizeText)) $o['SizeText'] = $this->SizeText;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        if (isset($this->CreatedText)) $o['CreatedText'] = $this->CreatedText;
        if (isset($this->CompletedAt)) $o['CompletedAt'] = JsonConverters::to('DateTime', $this->CompletedAt);
        if (isset($this->ExpiresAt)) $o['ExpiresAt'] = JsonConverters::to('DateTime', $this->ExpiresAt);
        if (isset($this->ExpiresText)) $o['ExpiresText'] = $this->ExpiresText;
        if (isset($this->Downloads)) $o['Downloads'] = $this->Downloads;
        if (isset($this->LastDownloadText)) $o['LastDownloadText'] = $this->LastDownloadText;
        return empty($o) ? new class(){} : $o;
    }
}

class FormZipPreviewResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $CanExport=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string */
        public string $FormUID='',
        /** @var string|null */
        public ?string $FormName=null,
        /** @var int */
        public int $Rows=0,
        /** @var int */
        public int $Submissions=0,
        /** @var int */
        public int $Files=0,
        /** @var int */
        public int $Bytes=0,
        /** @var string|null */
        public ?string $SizeText=null,
        /** @var int */
        public int $LeftOut=0,
        /** @var int */
        public int $SensitiveLeftOut=0,
        /** @var int */
        public int $KeepDays=0,
        /** @var int */
        public int $MaxFiles=0,
        /** @var int */
        public int $MaxBytes=0,
        /** @var FormZipJobView|null */
        public ?FormZipJobView $Existing=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CanExport'])) $this->CanExport = $o['CanExport'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
        if (isset($o['FormName'])) $this->FormName = $o['FormName'];
        if (isset($o['Rows'])) $this->Rows = $o['Rows'];
        if (isset($o['Submissions'])) $this->Submissions = $o['Submissions'];
        if (isset($o['Files'])) $this->Files = $o['Files'];
        if (isset($o['Bytes'])) $this->Bytes = $o['Bytes'];
        if (isset($o['SizeText'])) $this->SizeText = $o['SizeText'];
        if (isset($o['LeftOut'])) $this->LeftOut = $o['LeftOut'];
        if (isset($o['SensitiveLeftOut'])) $this->SensitiveLeftOut = $o['SensitiveLeftOut'];
        if (isset($o['KeepDays'])) $this->KeepDays = $o['KeepDays'];
        if (isset($o['MaxFiles'])) $this->MaxFiles = $o['MaxFiles'];
        if (isset($o['MaxBytes'])) $this->MaxBytes = $o['MaxBytes'];
        if (isset($o['Existing'])) $this->Existing = JsonConverters::from('FormZipJobView', $o['Existing']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CanExport)) $o['CanExport'] = $this->CanExport;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
        if (isset($this->FormName)) $o['FormName'] = $this->FormName;
        if (isset($this->Rows)) $o['Rows'] = $this->Rows;
        if (isset($this->Submissions)) $o['Submissions'] = $this->Submissions;
        if (isset($this->Files)) $o['Files'] = $this->Files;
        if (isset($this->Bytes)) $o['Bytes'] = $this->Bytes;
        if (isset($this->SizeText)) $o['SizeText'] = $this->SizeText;
        if (isset($this->LeftOut)) $o['LeftOut'] = $this->LeftOut;
        if (isset($this->SensitiveLeftOut)) $o['SensitiveLeftOut'] = $this->SensitiveLeftOut;
        if (isset($this->KeepDays)) $o['KeepDays'] = $this->KeepDays;
        if (isset($this->MaxFiles)) $o['MaxFiles'] = $this->MaxFiles;
        if (isset($this->MaxBytes)) $o['MaxBytes'] = $this->MaxBytes;
        if (isset($this->Existing)) $o['Existing'] = JsonConverters::to('FormZipJobView', $this->Existing);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class FormAnswerCond implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $F=null,
        /** @var string|null */
        public ?string $Op=null,
        /** @var string|null */
        public ?string $V=null
    ) {
    }

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

class FormSubmissionSearchRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $FormUID=null,
        /** @var string|null */
        public ?string $Mode=null,
        /** @var array<string>|null */
        public ?array $Forms=null,
        /** @var array<string>|null */
        public ?array $Stages=null,
        /** @var array<int>|null */
        public ?array $Assignees=null,
        /** @var array<string>|null */
        public ?array $Branches=null,
        /** @var array<string>|null */
        public ?array $Tags=null,
        /** @var string|null */
        public ?string $Search=null,
        /** @var string|null */
        public ?string $SortKey=null,
        /** @var int */
        public int $SortDir=0,
        /** @var int */
        public int $Skip=0,
        /** @var int */
        public int $Take=0,
        /** @var array<FormAnswerCond>|null */
        public ?array $Conds=null,
        /** @var array<string>|null */
        public ?array $Flags=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['FormUID'])) $this->FormUID = $o['FormUID'];
        if (isset($o['Mode'])) $this->Mode = $o['Mode'];
        if (isset($o['Forms'])) $this->Forms = JsonConverters::fromArray('Guid', $o['Forms']);
        if (isset($o['Stages'])) $this->Stages = JsonConverters::fromArray('string', $o['Stages']);
        if (isset($o['Assignees'])) $this->Assignees = JsonConverters::fromArray('int', $o['Assignees']);
        if (isset($o['Branches'])) $this->Branches = JsonConverters::fromArray('string', $o['Branches']);
        if (isset($o['Tags'])) $this->Tags = JsonConverters::fromArray('string', $o['Tags']);
        if (isset($o['Search'])) $this->Search = $o['Search'];
        if (isset($o['SortKey'])) $this->SortKey = $o['SortKey'];
        if (isset($o['SortDir'])) $this->SortDir = $o['SortDir'];
        if (isset($o['Skip'])) $this->Skip = $o['Skip'];
        if (isset($o['Take'])) $this->Take = $o['Take'];
        if (isset($o['Conds'])) $this->Conds = JsonConverters::fromArray('FormAnswerCond', $o['Conds']);
        if (isset($o['Flags'])) $this->Flags = JsonConverters::fromArray('string', $o['Flags']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->FormUID)) $o['FormUID'] = $this->FormUID;
        if (isset($this->Mode)) $o['Mode'] = $this->Mode;
        if (isset($this->Forms)) $o['Forms'] = JsonConverters::toArray('Guid', $this->Forms);
        if (isset($this->Stages)) $o['Stages'] = JsonConverters::toArray('string', $this->Stages);
        if (isset($this->Assignees)) $o['Assignees'] = JsonConverters::toArray('int', $this->Assignees);
        if (isset($this->Branches)) $o['Branches'] = JsonConverters::toArray('string', $this->Branches);
        if (isset($this->Tags)) $o['Tags'] = JsonConverters::toArray('string', $this->Tags);
        if (isset($this->Search)) $o['Search'] = $this->Search;
        if (isset($this->SortKey)) $o['SortKey'] = $this->SortKey;
        if (isset($this->SortDir)) $o['SortDir'] = $this->SortDir;
        if (isset($this->Skip)) $o['Skip'] = $this->Skip;
        if (isset($this->Take)) $o['Take'] = $this->Take;
        if (isset($this->Conds)) $o['Conds'] = JsonConverters::toArray('FormAnswerCond', $this->Conds);
        if (isset($this->Flags)) $o['Flags'] = JsonConverters::toArray('string', $this->Flags);
        return empty($o) ? new class(){} : $o;
    }
}

class FormZipPreviewRequest implements JsonSerializable
{
    public function __construct(
        /** @var FormSubmissionSearchRequest|null */
        public ?FormSubmissionSearchRequest $Query=null,
        /** @var array<string>|null */
        public ?array $SubmissionUIDs=null
    ) {
    }

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

PHP FormZipPreviewRequest 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/zip/preview HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<FormZipPreviewRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Query>
    <Assignees xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </Assignees>
    <Branches xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Branches>
    <Conds>
      <FormAnswerCond>
        <F>String</F>
        <Op>String</Op>
        <V>String</V>
      </FormAnswerCond>
    </Conds>
    <Flags xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Flags>
    <FormUID>00000000-0000-0000-0000-000000000000</FormUID>
    <Forms xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:guid>00000000-0000-0000-0000-000000000000</d3p1:guid>
    </Forms>
    <Mode>String</Mode>
    <Search>String</Search>
    <Skip>0</Skip>
    <SortDir>0</SortDir>
    <SortKey>String</SortKey>
    <Stages xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Stages>
    <Tags xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Tags>
    <Take>0</Take>
  </Query>
  <SubmissionUIDs xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
  </SubmissionUIDs>
</FormZipPreviewRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FormZipPreviewResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Bytes>0</Bytes>
  <CanExport>false</CanExport>
  <Existing>
    <Bytes>0</Bytes>
    <BytesIn>0</BytesIn>
    <CompletedAt>0001-01-01T00:00:00</CompletedAt>
    <CreatedAt>0001-01-01T00:00:00</CreatedAt>
    <CreatedText>String</CreatedText>
    <Downloads>0</Downloads>
    <ExpiresAt>0001-01-01T00:00:00</ExpiresAt>
    <ExpiresText>String</ExpiresText>
    <FileName>String</FileName>
    <Files>0</Files>
    <FilesIn>0</FilesIn>
    <FormName>String</FormName>
    <FormUID>00000000-0000-0000-0000-000000000000</FormUID>
    <LastDownloadText>String</LastDownloadText>
    <LeftOut>0</LeftOut>
    <LeftOutIn>0</LeftOutIn>
    <Message>String</Message>
    <SizeText>String</SizeText>
    <Status>String</Status>
    <StatusText>String</StatusText>
    <Submissions>0</Submissions>
    <ZipBytes>0</ZipBytes>
    <ZipUID>00000000-0000-0000-0000-000000000000</ZipUID>
  </Existing>
  <Files>0</Files>
  <FormName>String</FormName>
  <FormUID>00000000-0000-0000-0000-000000000000</FormUID>
  <KeepDays>0</KeepDays>
  <LeftOut>0</LeftOut>
  <MaxBytes>0</MaxBytes>
  <MaxFiles>0</MaxFiles>
  <Message>String</Message>
  <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>
  <Rows>0</Rows>
  <SensitiveLeftOut>0</SensitiveLeftOut>
  <SizeText>String</SizeText>
  <Submissions>0</Submissions>
</FormZipPreviewResponse>