Trendsic Platform Service

<back to all web services

AgentCategorizationRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/Report/AgentCategorization/{AgentId}/
GET,OPTIONS/v1/Report/AgentCategorization/{AgentId}/{ContactCategoryId}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class AgentCategorization implements IConvertible
{
    int? AgentId;
    String? AgentFirstName;
    String? AgentLastName;
    int? ContactId;
    String? ContactGUID;
    String? ContactFirstName;
    String? ContactLastName;
    int? ContactStatus;
    String? ContactStatusName;
    int? ContactCategory;
    String? ContactCategoryName;
    String? ContactEmail;
    String? ContactPhone;
    bool? IsShared;
    int? WritingAgentId;
    bool? IsWritingAgent;
    String? WritingAgentName;

    AgentCategorization({this.AgentId,this.AgentFirstName,this.AgentLastName,this.ContactId,this.ContactGUID,this.ContactFirstName,this.ContactLastName,this.ContactStatus,this.ContactStatusName,this.ContactCategory,this.ContactCategoryName,this.ContactEmail,this.ContactPhone,this.IsShared,this.WritingAgentId,this.IsWritingAgent,this.WritingAgentName});
    AgentCategorization.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AgentId = json['AgentId'];
        AgentFirstName = json['AgentFirstName'];
        AgentLastName = json['AgentLastName'];
        ContactId = json['ContactId'];
        ContactGUID = json['ContactGUID'];
        ContactFirstName = json['ContactFirstName'];
        ContactLastName = json['ContactLastName'];
        ContactStatus = json['ContactStatus'];
        ContactStatusName = json['ContactStatusName'];
        ContactCategory = json['ContactCategory'];
        ContactCategoryName = json['ContactCategoryName'];
        ContactEmail = json['ContactEmail'];
        ContactPhone = json['ContactPhone'];
        IsShared = json['IsShared'];
        WritingAgentId = json['WritingAgentId'];
        IsWritingAgent = json['IsWritingAgent'];
        WritingAgentName = json['WritingAgentName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AgentId': AgentId,
        'AgentFirstName': AgentFirstName,
        'AgentLastName': AgentLastName,
        'ContactId': ContactId,
        'ContactGUID': ContactGUID,
        'ContactFirstName': ContactFirstName,
        'ContactLastName': ContactLastName,
        'ContactStatus': ContactStatus,
        'ContactStatusName': ContactStatusName,
        'ContactCategory': ContactCategory,
        'ContactCategoryName': ContactCategoryName,
        'ContactEmail': ContactEmail,
        'ContactPhone': ContactPhone,
        'IsShared': IsShared,
        'WritingAgentId': WritingAgentId,
        'IsWritingAgent': IsWritingAgent,
        'WritingAgentName': WritingAgentName
    };

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

class AgentCategorizationResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<AgentCategorization>? Contacts = [];

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

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

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

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

class AgentCategorizationRequest implements IConvertible
{
    int? AgentId;
    int? ContactCategoryId;

    AgentCategorizationRequest({this.AgentId,this.ContactCategoryId});
    AgentCategorizationRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'AgentCategorization': TypeInfo(TypeOf.Class, create:() => AgentCategorization()),
    'AgentCategorizationResponse': TypeInfo(TypeOf.Class, create:() => AgentCategorizationResponse()),
    'List<AgentCategorization>': TypeInfo(TypeOf.Class, create:() => <AgentCategorization>[]),
    'AgentCategorizationRequest': TypeInfo(TypeOf.Class, create:() => AgentCategorizationRequest()),
});

Dart AgentCategorizationRequest 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.

GET /v1/Report/AgentCategorization/{AgentId}/ HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Contacts: 
	[
		{
			AgentId: 0,
			AgentFirstName: String,
			AgentLastName: String,
			ContactId: 0,
			ContactGUID: 00000000000000000000000000000000,
			ContactFirstName: String,
			ContactLastName: String,
			ContactStatus: 0,
			ContactStatusName: String,
			ContactCategory: 0,
			ContactCategoryName: String,
			ContactEmail: String,
			ContactPhone: String,
			IsShared: False,
			WritingAgentId: 0,
			IsWritingAgent: False,
			WritingAgentName: String
		}
	]
}