Platform API

<back to all web services

GetDataLists

Get custom data lists for a licensee, as well as standard data lists

Requires Authentication
The following routes are available for this service:
All Verbs/api/datalists/
<?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 ListItemModel implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ListItemId='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $ShortName=null,
        /** @var bool|null */
        public ?bool $IsDefault=null,
        /** @var int */
        public int $Order=0,
        /** @var string */
        public string $ListItemTrafficLightId='',
        /** @var string */
        public string $PrimaryListItemImageId='',
        /** @var string|null */
        public ?string $PrimaryListItemImageUrl=null,
        /** @var string|null */
        public ?string $PrimaryImageThumbnailUrl=null,
        /** @var string */
        public string $OwnerContactId='',
        /** @var string|null */
        public ?string $RecordStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ListItemId'])) $this->ListItemId = $o['ListItemId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ShortName'])) $this->ShortName = $o['ShortName'];
        if (isset($o['IsDefault'])) $this->IsDefault = $o['IsDefault'];
        if (isset($o['Order'])) $this->Order = $o['Order'];
        if (isset($o['ListItemTrafficLightId'])) $this->ListItemTrafficLightId = $o['ListItemTrafficLightId'];
        if (isset($o['PrimaryListItemImageId'])) $this->PrimaryListItemImageId = $o['PrimaryListItemImageId'];
        if (isset($o['PrimaryListItemImageUrl'])) $this->PrimaryListItemImageUrl = $o['PrimaryListItemImageUrl'];
        if (isset($o['PrimaryImageThumbnailUrl'])) $this->PrimaryImageThumbnailUrl = $o['PrimaryImageThumbnailUrl'];
        if (isset($o['OwnerContactId'])) $this->OwnerContactId = $o['OwnerContactId'];
        if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ListItemId)) $o['ListItemId'] = $this->ListItemId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ShortName)) $o['ShortName'] = $this->ShortName;
        if (isset($this->IsDefault)) $o['IsDefault'] = $this->IsDefault;
        if (isset($this->Order)) $o['Order'] = $this->Order;
        if (isset($this->ListItemTrafficLightId)) $o['ListItemTrafficLightId'] = $this->ListItemTrafficLightId;
        if (isset($this->PrimaryListItemImageId)) $o['PrimaryListItemImageId'] = $this->PrimaryListItemImageId;
        if (isset($this->PrimaryListItemImageUrl)) $o['PrimaryListItemImageUrl'] = $this->PrimaryListItemImageUrl;
        if (isset($this->PrimaryImageThumbnailUrl)) $o['PrimaryImageThumbnailUrl'] = $this->PrimaryImageThumbnailUrl;
        if (isset($this->OwnerContactId)) $o['OwnerContactId'] = $this->OwnerContactId;
        if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
        return empty($o) ? new class(){} : $o;
    }
}

class ListModel implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ListId='',
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Description=null,
        /** @var string|null */
        public ?string $ShortName=null,
        /** @var string */
        public string $OwnerContactId='',
        /** @var bool|null */
        public ?bool $IsStandard=null,
        /** @var string|null */
        public ?string $RecordStatus=null,
        /** @var string */
        public string $DefaultListItemId='',
        /** @var string|null */
        public ?string $DefaultListItemName=null,
        /** @var bool|null */
        public ?bool $HasImageForListItem=null,
        /** @var bool|null */
        public ?bool $HasTrafficLightForListItem=null,
        /** @var array<ListItemModel>|null */
        public ?array $ListItems=null,
        /** @var bool|null */
        public ?bool $PermissionEdit=null,
        /** @var bool|null */
        public ?bool $PermissionAdd=null,
        /** @var bool|null */
        public ?bool $PermissionDelete=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ListId'])) $this->ListId = $o['ListId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ShortName'])) $this->ShortName = $o['ShortName'];
        if (isset($o['OwnerContactId'])) $this->OwnerContactId = $o['OwnerContactId'];
        if (isset($o['IsStandard'])) $this->IsStandard = $o['IsStandard'];
        if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
        if (isset($o['DefaultListItemId'])) $this->DefaultListItemId = $o['DefaultListItemId'];
        if (isset($o['DefaultListItemName'])) $this->DefaultListItemName = $o['DefaultListItemName'];
        if (isset($o['HasImageForListItem'])) $this->HasImageForListItem = $o['HasImageForListItem'];
        if (isset($o['HasTrafficLightForListItem'])) $this->HasTrafficLightForListItem = $o['HasTrafficLightForListItem'];
        if (isset($o['ListItems'])) $this->ListItems = JsonConverters::fromArray('ListItemModel', $o['ListItems']);
        if (isset($o['PermissionEdit'])) $this->PermissionEdit = $o['PermissionEdit'];
        if (isset($o['PermissionAdd'])) $this->PermissionAdd = $o['PermissionAdd'];
        if (isset($o['PermissionDelete'])) $this->PermissionDelete = $o['PermissionDelete'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ListId)) $o['ListId'] = $this->ListId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ShortName)) $o['ShortName'] = $this->ShortName;
        if (isset($this->OwnerContactId)) $o['OwnerContactId'] = $this->OwnerContactId;
        if (isset($this->IsStandard)) $o['IsStandard'] = $this->IsStandard;
        if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
        if (isset($this->DefaultListItemId)) $o['DefaultListItemId'] = $this->DefaultListItemId;
        if (isset($this->DefaultListItemName)) $o['DefaultListItemName'] = $this->DefaultListItemName;
        if (isset($this->HasImageForListItem)) $o['HasImageForListItem'] = $this->HasImageForListItem;
        if (isset($this->HasTrafficLightForListItem)) $o['HasTrafficLightForListItem'] = $this->HasTrafficLightForListItem;
        if (isset($this->ListItems)) $o['ListItems'] = JsonConverters::toArray('ListItemModel', $this->ListItems);
        if (isset($this->PermissionEdit)) $o['PermissionEdit'] = $this->PermissionEdit;
        if (isset($this->PermissionAdd)) $o['PermissionAdd'] = $this->PermissionAdd;
        if (isset($this->PermissionDelete)) $o['PermissionDelete'] = $this->PermissionDelete;
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="Custom data lists for a licensee, as well as standard data lists")
class GetDataListsResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<ListModel>|null */
        public ?array $Lists=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

/** @description Get custom data lists for a licensee, as well as standard data lists */
// @Api(Description="Get custom data lists for a licensee, as well as standard data lists")
class GetDataLists implements JsonSerializable
{
    public function __construct(
        /** @description Licensee requested Custom data lists belong to. */
        // @ApiMember(DataType="Guid?", Description="Licensee requested Custom data lists belong to.", Name="LicenseeId", ParameterType="query")
        /** @var string|null */
        public ?string $LicenseeId=null,

        /** @description Specific text to search for. */
        // @ApiMember(DataType="string", Description="Specific text to search for.", Name="SearchText", ParameterType="query")
        /** @var string|null */
        public ?string $SearchText=null
    ) {
    }

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

PHP GetDataLists 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 /api/datalists/ HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"LicenseeId":"00000000000000000000000000000000","SearchText":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Lists":[{"ListId":"00000000-0000-0000-0000-000000000000","Name":"String","Description":"String","ShortName":"String","OwnerContactId":"00000000-0000-0000-0000-000000000000","IsStandard":false,"RecordStatus":"String","DefaultListItemId":"00000000-0000-0000-0000-000000000000","DefaultListItemName":"String","HasImageForListItem":false,"HasTrafficLightForListItem":false,"ListItems":[{"ListItemId":"00000000-0000-0000-0000-000000000000","Name":"String","Description":"String","ShortName":"String","IsDefault":false,"Order":0,"ListItemTrafficLightId":"00000000-0000-0000-0000-000000000000","PrimaryListItemImageId":"00000000-0000-0000-0000-000000000000","PrimaryListItemImageUrl":"String","PrimaryImageThumbnailUrl":"String","OwnerContactId":"00000000-0000-0000-0000-000000000000","RecordStatus":"String"}],"PermissionEdit":false,"PermissionAdd":false,"PermissionDelete":false}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}