Trendsic Platform Service

<back to all web services

FormSubmissionExportRequest

Requires Authentication
The following routes are available for this service:
POST/v1/forms/submissions/export
<?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 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 FormSubmissionExportRequest 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 FormSubmissionExportRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /v1/forms/submissions/export HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Query":{"FormUID":"00000000000000000000000000000000","Mode":"String","Forms":["00000000000000000000000000000000"],"Stages":["String"],"Assignees":[0],"Branches":["String"],"Tags":["String"],"Search":"String","SortKey":"String","SortDir":0,"Skip":0,"Take":0,"Conds":[{"F":"String","Op":"String","V":"String"}],"Flags":["String"]},"SubmissionUIDs":["00000000000000000000000000000000"]}