Platform API

<back to all web services

GetSlimContacts

Get contacts connected to the current contact or licensee (if managing licensee contacts) by criteria, returning minimal number of columns

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

enum SortOrder
{
    Ascending,
    Descending,
}

class PagedModel implements IConvertible
{
    /**
    * Page Number to retrieve
    */
    // @ApiMember(DataType="int", Description="Page Number to retrieve", Name="PageNumber")
    int? PageNumber;

    /**
    * Number of records to retrieve
    */
    // @ApiMember(DataType="int", Description="Number of records to retrieve", Name="PageSize")
    int? PageSize;

    /**
    * Index of field to sort results by
    */
    // @ApiMember(DataType="int", Description="Index of field to sort results by", Name="SortIndex")
    int? SortIndex;

    /**
    * Sort Order - Ascending or Descending
    */
    // @ApiMember(DataType="int", Description="Sort Order - Ascending or Descending", Name="SortOrder")
    SortOrder? SortOrder;

    PagedModel({this.PageNumber,this.PageSize,this.SortIndex,this.SortOrder});
    PagedModel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        PageNumber = json['PageNumber'];
        PageSize = json['PageSize'];
        SortIndex = json['SortIndex'];
        SortOrder = JsonConverters.fromJson(json['SortOrder'],'SortOrder',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'PageNumber': PageNumber,
        'PageSize': PageSize,
        'SortIndex': SortIndex,
        'SortOrder': JsonConverters.toJson(SortOrder,'SortOrder',context!)
    };

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

class ContactSummaryModel implements IConvertible
{
    /**
    * Contact linked to the profile
    */
    // @ApiMember(DataType="Guid", Description="Contact linked to the profile", Name="ContactId")
    String? ContactId;

    /**
    * Full name of the contact linked to the profile
    */
    // @ApiMember(DataType="string", Description="Full name of the contact linked to the profile", Name="ContactFullName")
    String? ContactFullName;

    /**
    * Email Address of the contact linked to the profile
    */
    // @ApiMember(DataType="string", Description="Email Address of the contact linked to the profile", Name="EmailAddress")
    String? EmailAddress;

    /**
    * Mobile Number of the contact linked to the profile
    */
    // @ApiMember(DataType="string", Description="Mobile Number of the contact linked to the profile", Name="MobileNumber")
    String? MobileNumber;

    /**
    * Primary Phone Number of the contact linked to the profile
    */
    // @ApiMember(DataType="string", Description="Primary Phone Number of the contact linked to the profile", Name="PhoneNumber")
    String? PhoneNumber;

    /**
    * Type of contact (person, organisation etc.) linked to the profile
    */
    // @ApiMember(DataType="string", Description="Type of contact (person, organisation etc.) linked to the profile", Name="ContactTypeId")
    String? ContactTypeId;

    /**
    * Profile photo of contact linked to the profile
    */
    // @ApiMember(DataType="string", Description="Profile photo of contact linked to the profile", Name="ProfilePhotoUrl")
    String? ProfilePhotoUrl;

    /**
    * Thumbnail photo of contact linked to the profile
    */
    // @ApiMember(DataType="string", Description="Thumbnail photo of contact linked to the profile", Name="ProfilePhotoThumbnailUrl")
    String? ProfilePhotoThumbnailUrl;

    /**
    * Profile description
    */
    // @ApiMember(DataType="string", Description="Profile description", Name="Description")
    String? Description;

    /**
    * Employment Industry
    */
    // @ApiMember(DataType="string", Description="Employment Industry", Name="EmploymentIndustry")
    String? EmploymentIndustry;

    /**
    * Employment Role
    */
    // @ApiMember(DataType="string", Description="Employment Role", Name="EmploymentRole")
    String? EmploymentRole;

    /**
    * Areas of Work
    */
    // @ApiMember(DataType="string", Description="Areas of Work", Name="EmploymentGeographicArea")
    String? EmploymentGeographicArea;

    /**
    * Timezone Name
    */
    // @ApiMember(DataType="string", Description="Timezone Name", Name="TimezoneName", ParameterType="query")
    String? TimezoneName;

    /**
    * The primary address of the contact
    */
    // @ApiMember(DataType="string", Description="The primary address of the contact", Name="PrimaryAddress", ParameterType="query")
    String? PrimaryAddress;

    /**
    * Have all connections to the contact been removed?
    */
    // @ApiMember(DataType="bool", Description="Have all connections to the contact been removed?", Name="IsRemovedContact")
    bool? IsRemovedContact;

    ContactSummaryModel({this.ContactId,this.ContactFullName,this.EmailAddress,this.MobileNumber,this.PhoneNumber,this.ContactTypeId,this.ProfilePhotoUrl,this.ProfilePhotoThumbnailUrl,this.Description,this.EmploymentIndustry,this.EmploymentRole,this.EmploymentGeographicArea,this.TimezoneName,this.PrimaryAddress,this.IsRemovedContact});
    ContactSummaryModel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ContactId = json['ContactId'];
        ContactFullName = json['ContactFullName'];
        EmailAddress = json['EmailAddress'];
        MobileNumber = json['MobileNumber'];
        PhoneNumber = json['PhoneNumber'];
        ContactTypeId = json['ContactTypeId'];
        ProfilePhotoUrl = json['ProfilePhotoUrl'];
        ProfilePhotoThumbnailUrl = json['ProfilePhotoThumbnailUrl'];
        Description = json['Description'];
        EmploymentIndustry = json['EmploymentIndustry'];
        EmploymentRole = json['EmploymentRole'];
        EmploymentGeographicArea = json['EmploymentGeographicArea'];
        TimezoneName = json['TimezoneName'];
        PrimaryAddress = json['PrimaryAddress'];
        IsRemovedContact = json['IsRemovedContact'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ContactId': ContactId,
        'ContactFullName': ContactFullName,
        'EmailAddress': EmailAddress,
        'MobileNumber': MobileNumber,
        'PhoneNumber': PhoneNumber,
        'ContactTypeId': ContactTypeId,
        'ProfilePhotoUrl': ProfilePhotoUrl,
        'ProfilePhotoThumbnailUrl': ProfilePhotoThumbnailUrl,
        'Description': Description,
        'EmploymentIndustry': EmploymentIndustry,
        'EmploymentRole': EmploymentRole,
        'EmploymentGeographicArea': EmploymentGeographicArea,
        'TimezoneName': TimezoneName,
        'PrimaryAddress': PrimaryAddress,
        'IsRemovedContact': IsRemovedContact
    };

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

// @ApiResponse(Description="Contacts connected to contact by criteria, returning minimal number of columns, and response status")
class GetSlimContactsResponse implements IConvertible
{
    List<ContactSummaryModel>? Contacts;
    int? TotalContacts;
    ResponseStatus? ResponseStatus;

    GetSlimContactsResponse({this.Contacts,this.TotalContacts,this.ResponseStatus});
    GetSlimContactsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

/**
* Get contacts connected to the current contact or licensee (if managing licensee contacts) by criteria, returning minimal number of columns
*/
// @Api(Description="Get contacts connected to the current contact or licensee (if managing licensee contacts) by criteria, returning minimal number of columns")
class GetSlimContacts extends PagedModel implements IConvertible
{
    /**
    * Specific search text to search for, e.g. Contact Name, Employment Details etc.
    */
    // @ApiMember(DataType="string", Description="Specific search text to search for, e.g. Contact Name, Employment Details etc.", Name="SearchText")
    String? SearchText;

    /**
    * Contact Types to search for, i.e. People and/or Organisations
    */
    // @ApiMember(DataType="List<Guid>", Description="Contact Types to search for, i.e. People and/or Organisations", IsRequired=true, Name="ContactTypes")
    List<String>? ContactTypes = [];

    /**
    * Contact statuses to search for, i.e. Real and/or Virtual
    */
    // @ApiMember(DataType="List<Guid>", Description="Contact statuses to search for, i.e. Real and/or Virtual", IsRequired=true, Name="Statuses")
    List<String>? Statuses = [];

    /**
    * Include contacts previously connected to the contact but now removed.
    */
    // @ApiMember(DataType="bool", Description="Include contacts previously connected to the contact but now removed.", Name="IncludeRemoved")
    bool? IncludeRemoved;

    /**
    * Return all contacts matching criteria, or paged results?
    */
    // @ApiMember(Description="Return all contacts matching criteria, or paged results?", Name="IsPagedMode")
    bool? IsPagedMode;

    GetSlimContacts({this.SearchText,this.ContactTypes,this.Statuses,this.IncludeRemoved,this.IsPagedMode});
    GetSlimContacts.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        SearchText = json['SearchText'];
        ContactTypes = JsonConverters.fromJson(json['ContactTypes'],'List<String>',context!);
        Statuses = JsonConverters.fromJson(json['Statuses'],'List<String>',context!);
        IncludeRemoved = json['IncludeRemoved'];
        IsPagedMode = json['IsPagedMode'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'SearchText': SearchText,
        'ContactTypes': JsonConverters.toJson(ContactTypes,'List<String>',context!),
        'Statuses': JsonConverters.toJson(Statuses,'List<String>',context!),
        'IncludeRemoved': IncludeRemoved,
        'IsPagedMode': IsPagedMode
    });

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

TypeContext _ctx = TypeContext(library: 'pfapi.pstpf.com.au', types: <String, TypeInfo> {
    'SortOrder': TypeInfo(TypeOf.Enum, enumValues:SortOrder.values),
    'PagedModel': TypeInfo(TypeOf.Class, create:() => PagedModel()),
    'ContactSummaryModel': TypeInfo(TypeOf.Class, create:() => ContactSummaryModel()),
    'GetSlimContactsResponse': TypeInfo(TypeOf.Class, create:() => GetSlimContactsResponse()),
    'List<ContactSummaryModel>': TypeInfo(TypeOf.Class, create:() => <ContactSummaryModel>[]),
    'GetSlimContacts': TypeInfo(TypeOf.Class, create:() => GetSlimContacts()),
});

Dart GetSlimContacts 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/slimcontacts HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"SearchText":"String","ContactTypes":["00000000-0000-0000-0000-000000000000"],"Statuses":["00000000-0000-0000-0000-000000000000"],"IncludeRemoved":false,"IsPagedMode":false,"PageNumber":0,"PageSize":0,"SortIndex":0,"SortOrder":"Ascending"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Contacts":[{"ContactId":"00000000-0000-0000-0000-000000000000","ContactFullName":"String","EmailAddress":"String","MobileNumber":"String","PhoneNumber":"String","ContactTypeId":"00000000-0000-0000-0000-000000000000","ProfilePhotoUrl":"String","ProfilePhotoThumbnailUrl":"String","Description":"String","EmploymentIndustry":"String","EmploymentRole":"String","EmploymentGeographicArea":"String","TimezoneName":"String","PrimaryAddress":"String","IsRemovedContact":false}],"TotalContacts":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}