Platform API

<back to all web services

GetPagedContactsInRole

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

class GetPagedContactsInRole extends PagedModel implements IConvertible
{
    /**
    * Get contacts connected to the current licensee in the specified role
    */
    // @ApiMember(Description="Get contacts connected to the current licensee in the specified role", Name="RoleId")
    String? RoleId;

    /**
    * Get contacts of the specified type
    */
    // @ApiMember(Description="Get contacts of the specified type", 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 = [];

    /**
    * Text to filter contacts on. searches for a contact with matches to the string.
    */
    // @ApiMember(DataType="string", Description="Text to filter contacts on. searches for a contact with matches to the string.", Name="SearchText")
    String? SearchText;

    /**
    * If you want just bare-bones contact info set this to false, if not specified it defaults to true.
    */
    // @ApiMember(DataType="bool?", Description="If you want just bare-bones contact info set this to false, if not specified it defaults to true.", Name="IncludeDetails")
    bool? IncludeDetails;

    GetPagedContactsInRole({this.RoleId,this.ContactTypes,this.Statuses,this.SearchText,this.IncludeDetails});
    GetPagedContactsInRole.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

    getTypeName() => "GetPagedContactsInRole";
    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>[]),
    'GetPagedContactsInRole': TypeInfo(TypeOf.Class, create:() => GetPagedContactsInRole()),
});

Dart GetPagedContactsInRole 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/contacts/paged/{RoleId} HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"RoleId":"00000000-0000-0000-0000-000000000000","ContactTypes":["00000000-0000-0000-0000-000000000000"],"Statuses":["00000000-0000-0000-0000-000000000000"],"SearchText":"String","IncludeDetails":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"}}}