Platform API

<back to all web services

GetList

Get specified list and list items

Requires Authentication
The following routes are available for this service:
All Verbs/api/lists/{ListId}
import 'package:servicestack/servicestack.dart';

class ListItemModel implements IConvertible
{
    String? ListItemId;
    String? Name;
    String? Description;
    String? ShortName;
    bool? IsDefault;
    int? Order;
    String? ListItemTrafficLightId;
    String? PrimaryListItemImageId;
    String? PrimaryListItemImageUrl;
    String? PrimaryImageThumbnailUrl;
    String? OwnerContactId;
    String? RecordStatus;

    ListItemModel({this.ListItemId,this.Name,this.Description,this.ShortName,this.IsDefault,this.Order,this.ListItemTrafficLightId,this.PrimaryListItemImageId,this.PrimaryListItemImageUrl,this.PrimaryImageThumbnailUrl,this.OwnerContactId,this.RecordStatus});
    ListItemModel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ListItemId = json['ListItemId'];
        Name = json['Name'];
        Description = json['Description'];
        ShortName = json['ShortName'];
        IsDefault = json['IsDefault'];
        Order = json['Order'];
        ListItemTrafficLightId = json['ListItemTrafficLightId'];
        PrimaryListItemImageId = json['PrimaryListItemImageId'];
        PrimaryListItemImageUrl = json['PrimaryListItemImageUrl'];
        PrimaryImageThumbnailUrl = json['PrimaryImageThumbnailUrl'];
        OwnerContactId = json['OwnerContactId'];
        RecordStatus = json['RecordStatus'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ListItemId': ListItemId,
        'Name': Name,
        'Description': Description,
        'ShortName': ShortName,
        'IsDefault': IsDefault,
        'Order': Order,
        'ListItemTrafficLightId': ListItemTrafficLightId,
        'PrimaryListItemImageId': PrimaryListItemImageId,
        'PrimaryListItemImageUrl': PrimaryListItemImageUrl,
        'PrimaryImageThumbnailUrl': PrimaryImageThumbnailUrl,
        'OwnerContactId': OwnerContactId,
        'RecordStatus': RecordStatus
    };

    getTypeName() => "ListItemModel";
    TypeContext? context = _ctx;
}

class ListModel implements IConvertible
{
    String? ListId;
    String? Name;
    String? Description;
    String? ShortName;
    String? OwnerContactId;
    bool? IsStandard;
    String? RecordStatus;
    String? DefaultListItemId;
    String? DefaultListItemName;
    bool? HasImageForListItem;
    bool? HasTrafficLightForListItem;
    List<ListItemModel>? ListItems;
    bool? PermissionEdit;
    bool? PermissionAdd;
    bool? PermissionDelete;

    ListModel({this.ListId,this.Name,this.Description,this.ShortName,this.OwnerContactId,this.IsStandard,this.RecordStatus,this.DefaultListItemId,this.DefaultListItemName,this.HasImageForListItem,this.HasTrafficLightForListItem,this.ListItems,this.PermissionEdit,this.PermissionAdd,this.PermissionDelete});
    ListModel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ListId = json['ListId'];
        Name = json['Name'];
        Description = json['Description'];
        ShortName = json['ShortName'];
        OwnerContactId = json['OwnerContactId'];
        IsStandard = json['IsStandard'];
        RecordStatus = json['RecordStatus'];
        DefaultListItemId = json['DefaultListItemId'];
        DefaultListItemName = json['DefaultListItemName'];
        HasImageForListItem = json['HasImageForListItem'];
        HasTrafficLightForListItem = json['HasTrafficLightForListItem'];
        ListItems = JsonConverters.fromJson(json['ListItems'],'List<ListItemModel>',context!);
        PermissionEdit = json['PermissionEdit'];
        PermissionAdd = json['PermissionAdd'];
        PermissionDelete = json['PermissionDelete'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ListId': ListId,
        'Name': Name,
        'Description': Description,
        'ShortName': ShortName,
        'OwnerContactId': OwnerContactId,
        'IsStandard': IsStandard,
        'RecordStatus': RecordStatus,
        'DefaultListItemId': DefaultListItemId,
        'DefaultListItemName': DefaultListItemName,
        'HasImageForListItem': HasImageForListItem,
        'HasTrafficLightForListItem': HasTrafficLightForListItem,
        'ListItems': JsonConverters.toJson(ListItems,'List<ListItemModel>',context!),
        'PermissionEdit': PermissionEdit,
        'PermissionAdd': PermissionAdd,
        'PermissionDelete': PermissionDelete
    };

    getTypeName() => "ListModel";
    TypeContext? context = _ctx;
}

// @ApiResponse(Description="List and list items")
class GetListResponse implements IConvertible
{
    ListModel? List;
    ResponseStatus? ResponseStatus;

    GetListResponse({this.List,this.ResponseStatus});
    GetListResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        List = JsonConverters.fromJson(json['List'],'ListModel',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'List': JsonConverters.toJson(List,'ListModel',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "GetListResponse";
    TypeContext? context = _ctx;
}

/**
* Get specified list and list items
*/
// @Api(Description="Get specified list and list items")
class GetList implements IConvertible
{
    /**
    * Get list and list items for the specified list id
    */
    // @ApiMember(Description="Get list and list items for the specified list id", Name="ListId")
    String? ListId;

    GetList({this.ListId});
    GetList.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ListId = json['ListId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ListId': ListId
    };

    getTypeName() => "GetList";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'pfapi.pstpf.com.au', types: <String, TypeInfo> {
    'ListItemModel': TypeInfo(TypeOf.Class, create:() => ListItemModel()),
    'ListModel': TypeInfo(TypeOf.Class, create:() => ListModel()),
    'List<ListItemModel>': TypeInfo(TypeOf.Class, create:() => <ListItemModel>[]),
    'GetListResponse': TypeInfo(TypeOf.Class, create:() => GetListResponse()),
    'GetList': TypeInfo(TypeOf.Class, create:() => GetList()),
});

Dart GetList DTOs

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

HTTP + JSV

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

POST /api/lists/{ListId} HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	List: 
	{
		Name: String,
		Description: String,
		ShortName: String,
		IsStandard: False,
		RecordStatus: String,
		DefaultListItemName: String,
		HasImageForListItem: False,
		HasTrafficLightForListItem: False,
		ListItems: 
		[
			{
				Name: String,
				Description: String,
				ShortName: String,
				IsDefault: False,
				Order: 0,
				PrimaryListItemImageUrl: String,
				PrimaryImageThumbnailUrl: String,
				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
		}
	}
}