Platform API

<back to all web services

GetRolesForConnection

Get roles for the specified contact

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

class RoleModel implements IConvertible
{
    /**
    * Role Id
    */
    // @ApiMember(DataType="Guid", Description="Role Id", IsRequired=true, Name="RoleId")
    String? RoleId;

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

    /**
    * Is the role a licensee role?
    */
    // @ApiMember(DataType="bool", Description="Is the role a licensee role?", Name="IsLicensee")
    bool? IsLicenseeRole;

    /**
    * Is manage contacts role?
    */
    // @ApiMember(DataType="bool", Description="Is manage contacts role?", Name="IsManageContacts")
    bool? IsManageContacts;

    /**
    * Is the role a Platform role?
    */
    // @ApiMember(DataType="bool", Description="Is the role a Platform role?", Name="IsPlatformRole")
    bool? IsPlatformRole;

    /**
    * Is the role a services role?
    */
    // @ApiMember(DataType="bool", Description="Is the role a services role?", Name="IsServiceRole")
    bool? IsServiceRole;

    /**
    * Is the role a customer role?
    */
    // @ApiMember(DataType="bool", Description="Is the role a customer role?", Name="IsCustomerRole")
    bool? IsCustomerRole;

    /**
    * Is the role a functional role?
    */
    // @ApiMember(DataType="bool", Description="Is the role a functional role?", Name="IsFunctionalRole")
    bool? IsFunctionalRole;

    /**
    * Is the role an auto-accept role?
    */
    // @ApiMember(DataType="bool", Description="Is the role an auto-accept role?", Name="IsRequestAutoAccepted")
    bool? IsRequestAutoAccepted;

    /**
    * Suite that the role belongs to
    */
    // @ApiMember(DataType="Guid", Description="Suite that the role belongs to", Name="SuiteId")
    String? SuiteId;

    /**
    * Suite that the role belongs to
    */
    // @ApiMember(DataType="string", Description="Suite that the role belongs to", Name="SuiteName")
    String? SuiteName;

    /**
    * 'A' (Active) or 'I' (Inactive)
    */
    // @ApiMember(DataType="string", Description="'A' (Active) or 'I' (Inactive)", Name="RecordStatus")
    String? RecordStatus;

    /**
    * Object Connection Id, which is populated when the roles are returned based on those that are connected to an object.
    */
    // @ApiMember(DataType="Guid", Description="Object Connection Id, which is populated when the roles are returned based on those that are connected to an object.", Name="ObjectConnectionId")
    String? ObjectConnectionId;

    RoleModel({this.RoleId,this.RoleName,this.IsLicenseeRole,this.IsManageContacts,this.IsPlatformRole,this.IsServiceRole,this.IsCustomerRole,this.IsFunctionalRole,this.IsRequestAutoAccepted,this.SuiteId,this.SuiteName,this.RecordStatus,this.ObjectConnectionId});
    RoleModel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        RoleId = json['RoleId'];
        RoleName = json['RoleName'];
        IsLicenseeRole = json['IsLicenseeRole'];
        IsManageContacts = json['IsManageContacts'];
        IsPlatformRole = json['IsPlatformRole'];
        IsServiceRole = json['IsServiceRole'];
        IsCustomerRole = json['IsCustomerRole'];
        IsFunctionalRole = json['IsFunctionalRole'];
        IsRequestAutoAccepted = json['IsRequestAutoAccepted'];
        SuiteId = json['SuiteId'];
        SuiteName = json['SuiteName'];
        RecordStatus = json['RecordStatus'];
        ObjectConnectionId = json['ObjectConnectionId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'RoleId': RoleId,
        'RoleName': RoleName,
        'IsLicenseeRole': IsLicenseeRole,
        'IsManageContacts': IsManageContacts,
        'IsPlatformRole': IsPlatformRole,
        'IsServiceRole': IsServiceRole,
        'IsCustomerRole': IsCustomerRole,
        'IsFunctionalRole': IsFunctionalRole,
        'IsRequestAutoAccepted': IsRequestAutoAccepted,
        'SuiteId': SuiteId,
        'SuiteName': SuiteName,
        'RecordStatus': RecordStatus,
        'ObjectConnectionId': ObjectConnectionId
    };

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

// @ApiResponse(Description="List of roles available for connection from the specified contact for specified contact types")
class GetRolesForConnectionResponse implements IConvertible
{
    List<RoleModel>? Roles;
    ResponseStatus? ResponseStatus;

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

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

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

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

/**
* Get roles for the specified contact
*/
// @Api(Description="Get roles for the specified contact")
class GetRolesForConnection implements IConvertible
{
    /**
    * Get roles available for connection from this contact
    */
    // @ApiMember(Description="Get roles available for connection from this contact", IsRequired=true, Name="FromContactId")
    String? FromContactId;

    /**
    * Get roles available for connection to this contact
    */
    // @ApiMember(Description="Get roles available for connection to this contact", Name="ContactId")
    String? ContactId;

    /**
    * Get roles available for connection for the specified contact type
    */
    // @ApiMember(Description="Get roles available for connection for the specified contact type", IsRequired=true, Name="ContactTypeId")
    String? ContactTypeId;

    GetRolesForConnection({this.FromContactId,this.ContactId,this.ContactTypeId});
    GetRolesForConnection.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'FromContactId': FromContactId,
        'ContactId': ContactId,
        'ContactTypeId': ContactTypeId
    };

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

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

Dart GetRolesForConnection DTOs

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

HTTP + OTHER

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

POST /api/roles/connection/{FromContactId} HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"FromContactId":"00000000-0000-0000-0000-000000000000","ContactId":"00000000000000000000000000000000","ContactTypeId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Roles":[{"RoleId":"00000000-0000-0000-0000-000000000000","RoleName":"String","IsLicenseeRole":false,"IsManageContacts":false,"IsPlatformRole":false,"IsServiceRole":false,"IsCustomerRole":false,"IsFunctionalRole":false,"IsRequestAutoAccepted":false,"SuiteId":"00000000-0000-0000-0000-000000000000","SuiteName":"String","RecordStatus":"String","ObjectConnectionId":"00000000-0000-0000-0000-000000000000"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}