Platform API

<back to all web services

GetListItem

Get details of the specified list item

Requires Authentication
The following routes are available for this service:
All Verbs/api/listitems/{ListItemId}
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;
}

// @ApiResponse(Description="List item details")
class GetListItemResponse implements IConvertible
{
    ListItemModel? ListItem;
    ResponseStatus? ResponseStatus;

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

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

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

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

/**
* Get details of the specified list item
*/
// @Api(Description="Get details of the specified list item")
class GetListItem implements IConvertible
{
    /**
    * List item id to retrieve details for
    */
    // @ApiMember(DataType="Guid", Description="List item id to retrieve details for", IsRequired=true, Name="ListItemId", ParameterType="query")
    String? ListItemId;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'pfapi.pstpf.com.au', types: <String, TypeInfo> {
    'ListItemModel': TypeInfo(TypeOf.Class, create:() => ListItemModel()),
    'GetListItemResponse': TypeInfo(TypeOf.Class, create:() => GetListItemResponse()),
    'GetListItem': TypeInfo(TypeOf.Class, create:() => GetListItem()),
});

Dart GetListItem 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/listitems/{ListItemId} 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

{
	ListItem: 
	{
		Name: String,
		Description: String,
		ShortName: String,
		IsDefault: False,
		Order: 0,
		PrimaryListItemImageUrl: String,
		PrimaryImageThumbnailUrl: String,
		RecordStatus: String
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}