Trendsic Platform Service

<back to all web services

ContactCategoryRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator
The following routes are available for this service:
GET,PUT,OPTIONS/v1/ContactCategory/
import 'package:servicestack/servicestack.dart';

class ContactCategory implements IConvertible
{
    int? Id;
    String? Name;

    ContactCategory({this.Id,this.Name});
    ContactCategory.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class ContactCategoryResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<ContactCategory>? ContactCategories = [];

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

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

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

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

class ContactCategoryRequest implements IConvertible
{
    String? ContactGUID;
    int? CategoryId;

    ContactCategoryRequest({this.ContactGUID,this.CategoryId});
    ContactCategoryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

Dart ContactCategoryRequest DTOs

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

HTTP + CSV

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

PUT /v1/ContactCategory/ HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"ContactGUID":"00000000000000000000000000000000","CategoryId":0}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"ContactCategories":[{"Id":0,"Name":"String"}]}