Trendsic Platform Service

<back to all web services

RecordGetRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/records/entry/{RecordKey}
<?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 RecordDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $RecordId=0,
        /** @var string|null */
        public ?string $RecordKey=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var int|null */
        public ?int $SeriesId=null,
        /** @var string|null */
        public ?string $SeriesKey=null,
        /** @var string|null */
        public ?string $Classification=null,
        /** @var string|null */
        public ?string $Format=null,
        /** @var string|null */
        public ?string $Phase=null,
        /** @var string|null */
        public ?string $TriggerDate=null,
        /** @var bool|null */
        public ?bool $Staged=null,
        /** @var int|null */
        public ?int $HoldId=null,
        /** @var string|null */
        public ?string $HoldKey=null,
        /** @var string|null */
        public ?string $OwnerName=null,
        /** @var string|null */
        public ?string $Branch=null,
        /** @var string|null */
        public ?string $Barcode=null,
        /** @var string|null */
        public ?string $LocJson=null,
        /** @var string|null */
        public ?string $MetaJson=null,
        /** @var string|null */
        public ?string $FilesJson=null,
        /** @var string|null */
        public ?string $VersionsJson=null,
        /** @var string|null */
        public ?string $RelatedJson=null,
        /** @var string|null */
        public ?string $DisposedJson=null,
        /** @var string|null */
        public ?string $CreatedLabel=null,
        /** @var string|null */
        public ?string $UpdatedLabel=null,
        /** @var string|null */
        public ?string $Lifecycle=null,
        /** @var string|null */
        public ?string $RetKind=null,
        /** @var string|null */
        public ?string $EligibleDate=null,
        /** @var int */
        public int $MonthsLeft=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RecordId'])) $this->RecordId = $o['RecordId'];
        if (isset($o['RecordKey'])) $this->RecordKey = $o['RecordKey'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['SeriesId'])) $this->SeriesId = $o['SeriesId'];
        if (isset($o['SeriesKey'])) $this->SeriesKey = $o['SeriesKey'];
        if (isset($o['Classification'])) $this->Classification = $o['Classification'];
        if (isset($o['Format'])) $this->Format = $o['Format'];
        if (isset($o['Phase'])) $this->Phase = $o['Phase'];
        if (isset($o['TriggerDate'])) $this->TriggerDate = $o['TriggerDate'];
        if (isset($o['Staged'])) $this->Staged = $o['Staged'];
        if (isset($o['HoldId'])) $this->HoldId = $o['HoldId'];
        if (isset($o['HoldKey'])) $this->HoldKey = $o['HoldKey'];
        if (isset($o['OwnerName'])) $this->OwnerName = $o['OwnerName'];
        if (isset($o['Branch'])) $this->Branch = $o['Branch'];
        if (isset($o['Barcode'])) $this->Barcode = $o['Barcode'];
        if (isset($o['LocJson'])) $this->LocJson = $o['LocJson'];
        if (isset($o['MetaJson'])) $this->MetaJson = $o['MetaJson'];
        if (isset($o['FilesJson'])) $this->FilesJson = $o['FilesJson'];
        if (isset($o['VersionsJson'])) $this->VersionsJson = $o['VersionsJson'];
        if (isset($o['RelatedJson'])) $this->RelatedJson = $o['RelatedJson'];
        if (isset($o['DisposedJson'])) $this->DisposedJson = $o['DisposedJson'];
        if (isset($o['CreatedLabel'])) $this->CreatedLabel = $o['CreatedLabel'];
        if (isset($o['UpdatedLabel'])) $this->UpdatedLabel = $o['UpdatedLabel'];
        if (isset($o['Lifecycle'])) $this->Lifecycle = $o['Lifecycle'];
        if (isset($o['RetKind'])) $this->RetKind = $o['RetKind'];
        if (isset($o['EligibleDate'])) $this->EligibleDate = $o['EligibleDate'];
        if (isset($o['MonthsLeft'])) $this->MonthsLeft = $o['MonthsLeft'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RecordId)) $o['RecordId'] = $this->RecordId;
        if (isset($this->RecordKey)) $o['RecordKey'] = $this->RecordKey;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->SeriesId)) $o['SeriesId'] = $this->SeriesId;
        if (isset($this->SeriesKey)) $o['SeriesKey'] = $this->SeriesKey;
        if (isset($this->Classification)) $o['Classification'] = $this->Classification;
        if (isset($this->Format)) $o['Format'] = $this->Format;
        if (isset($this->Phase)) $o['Phase'] = $this->Phase;
        if (isset($this->TriggerDate)) $o['TriggerDate'] = $this->TriggerDate;
        if (isset($this->Staged)) $o['Staged'] = $this->Staged;
        if (isset($this->HoldId)) $o['HoldId'] = $this->HoldId;
        if (isset($this->HoldKey)) $o['HoldKey'] = $this->HoldKey;
        if (isset($this->OwnerName)) $o['OwnerName'] = $this->OwnerName;
        if (isset($this->Branch)) $o['Branch'] = $this->Branch;
        if (isset($this->Barcode)) $o['Barcode'] = $this->Barcode;
        if (isset($this->LocJson)) $o['LocJson'] = $this->LocJson;
        if (isset($this->MetaJson)) $o['MetaJson'] = $this->MetaJson;
        if (isset($this->FilesJson)) $o['FilesJson'] = $this->FilesJson;
        if (isset($this->VersionsJson)) $o['VersionsJson'] = $this->VersionsJson;
        if (isset($this->RelatedJson)) $o['RelatedJson'] = $this->RelatedJson;
        if (isset($this->DisposedJson)) $o['DisposedJson'] = $this->DisposedJson;
        if (isset($this->CreatedLabel)) $o['CreatedLabel'] = $this->CreatedLabel;
        if (isset($this->UpdatedLabel)) $o['UpdatedLabel'] = $this->UpdatedLabel;
        if (isset($this->Lifecycle)) $o['Lifecycle'] = $this->Lifecycle;
        if (isset($this->RetKind)) $o['RetKind'] = $this->RetKind;
        if (isset($this->EligibleDate)) $o['EligibleDate'] = $this->EligibleDate;
        if (isset($this->MonthsLeft)) $o['MonthsLeft'] = $this->MonthsLeft;
        return empty($o) ? new class(){} : $o;
    }
}

class RecordGetResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var RecordDto|null */
        public ?RecordDto $Record=null
    ) {
    }

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

class RecordGetRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $RecordKey=null
    ) {
    }

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

PHP RecordGetRequest 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.

GET /v1/records/entry/{RecordKey} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Record":{"RecordId":0,"RecordKey":"String","Name":"String","SeriesId":0,"SeriesKey":"String","Classification":"String","Format":"String","Phase":"String","TriggerDate":"String","Staged":false,"HoldId":0,"HoldKey":"String","OwnerName":"String","Branch":"String","Barcode":"String","LocJson":"String","MetaJson":"String","FilesJson":"String","VersionsJson":"String","RelatedJson":"String","DisposedJson":"String","CreatedLabel":"String","UpdatedLabel":"String","Lifecycle":"String","RetKind":"String","EligibleDate":"String","MonthsLeft":0}}