Trendsic Platform Service

<back to all web services

CustomerThreadRequest

The following routes are available for this service:
GET/v1/c/thread/{Kind}/{RefId}
import 'package:servicestack/servicestack.dart';

class JobThreadMessageView implements IConvertible
{
    int? Id;
    String? Party;
    bool? Mine;
    String? Who;
    String? Body;
    bool? ViaVoice;
    bool? IsStatusChip;
    String? ChipKey;
    DateTime? SentUtc;
    String? SentLocal;
    bool? Seen;

    JobThreadMessageView({this.Id,this.Party,this.Mine,this.Who,this.Body,this.ViaVoice,this.IsStatusChip,this.ChipKey,this.SentUtc,this.SentLocal,this.Seen});
    JobThreadMessageView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Party = json['Party'];
        Mine = json['Mine'];
        Who = json['Who'];
        Body = json['Body'];
        ViaVoice = json['ViaVoice'];
        IsStatusChip = json['IsStatusChip'];
        ChipKey = json['ChipKey'];
        SentUtc = JsonConverters.fromJson(json['SentUtc'],'DateTime',context!);
        SentLocal = json['SentLocal'];
        Seen = json['Seen'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Party': Party,
        'Mine': Mine,
        'Who': Who,
        'Body': Body,
        'ViaVoice': ViaVoice,
        'IsStatusChip': IsStatusChip,
        'ChipKey': ChipKey,
        'SentUtc': JsonConverters.toJson(SentUtc,'DateTime',context!),
        'SentLocal': SentLocal,
        'Seen': Seen
    };

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

class JobThreadView implements IConvertible
{
    int? Id;
    String? Kind;
    int? RefId;
    String? RefCode;
    int? WorkerContactId;
    String? Who;
    bool? Closed;
    String? ClosesLocal;
    int? Unread;
    String? Note;
    List<String>? QuickReplies = [];
    List<JobThreadMessageView>? Messages = [];

    JobThreadView({this.Id,this.Kind,this.RefId,this.RefCode,this.WorkerContactId,this.Who,this.Closed,this.ClosesLocal,this.Unread,this.Note,this.QuickReplies,this.Messages});
    JobThreadView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Kind = json['Kind'];
        RefId = json['RefId'];
        RefCode = json['RefCode'];
        WorkerContactId = json['WorkerContactId'];
        Who = json['Who'];
        Closed = json['Closed'];
        ClosesLocal = json['ClosesLocal'];
        Unread = json['Unread'];
        Note = json['Note'];
        QuickReplies = JsonConverters.fromJson(json['QuickReplies'],'List<String>',context!);
        Messages = JsonConverters.fromJson(json['Messages'],'List<JobThreadMessageView>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Kind': Kind,
        'RefId': RefId,
        'RefCode': RefCode,
        'WorkerContactId': WorkerContactId,
        'Who': Who,
        'Closed': Closed,
        'ClosesLocal': ClosesLocal,
        'Unread': Unread,
        'Note': Note,
        'QuickReplies': JsonConverters.toJson(QuickReplies,'List<String>',context!),
        'Messages': JsonConverters.toJson(Messages,'List<JobThreadMessageView>',context!)
    };

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

class ProblemReasonView implements IConvertible
{
    String? Key;
    String? Label;

    ProblemReasonView({this.Key,this.Label});
    ProblemReasonView.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Key': Key,
        'Label': Label
    };

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

class CustomerThreadResponse implements IConvertible
{
    List<JobThreadView>? Threads = [];
    List<ProblemReasonView>? ProblemReasons = [];
    String? Message;
    ResponseStatus? ResponseStatus;

    CustomerThreadResponse({this.Threads,this.ProblemReasons,this.Message,this.ResponseStatus});
    CustomerThreadResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Threads = JsonConverters.fromJson(json['Threads'],'List<JobThreadView>',context!);
        ProblemReasons = JsonConverters.fromJson(json['ProblemReasons'],'List<ProblemReasonView>',context!);
        Message = json['Message'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Threads': JsonConverters.toJson(Threads,'List<JobThreadView>',context!),
        'ProblemReasons': JsonConverters.toJson(ProblemReasons,'List<ProblemReasonView>',context!),
        'Message': Message,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class CustomerThreadRequest implements IConvertible
{
    String? Kind;
    int? RefId;

    CustomerThreadRequest({this.Kind,this.RefId});
    CustomerThreadRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Kind': Kind,
        'RefId': RefId
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'JobThreadMessageView': TypeInfo(TypeOf.Class, create:() => JobThreadMessageView()),
    'JobThreadView': TypeInfo(TypeOf.Class, create:() => JobThreadView()),
    'List<JobThreadMessageView>': TypeInfo(TypeOf.Class, create:() => <JobThreadMessageView>[]),
    'ProblemReasonView': TypeInfo(TypeOf.Class, create:() => ProblemReasonView()),
    'CustomerThreadResponse': TypeInfo(TypeOf.Class, create:() => CustomerThreadResponse()),
    'List<JobThreadView>': TypeInfo(TypeOf.Class, create:() => <JobThreadView>[]),
    'List<ProblemReasonView>': TypeInfo(TypeOf.Class, create:() => <ProblemReasonView>[]),
    'CustomerThreadRequest': TypeInfo(TypeOf.Class, create:() => CustomerThreadRequest()),
});

Dart CustomerThreadRequest DTOs

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

HTTP + XML

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

GET /v1/c/thread/{Kind}/{RefId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerThreadResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Message>String</Message>
  <ProblemReasons>
    <ProblemReasonView>
      <Key>String</Key>
      <Label>String</Label>
    </ProblemReasonView>
  </ProblemReasons>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Threads>
    <JobThreadView>
      <Closed>false</Closed>
      <ClosesLocal>String</ClosesLocal>
      <Id>0</Id>
      <Kind>String</Kind>
      <Messages>
        <JobThreadMessageView>
          <Body>String</Body>
          <ChipKey>String</ChipKey>
          <Id>0</Id>
          <IsStatusChip>false</IsStatusChip>
          <Mine>false</Mine>
          <Party>String</Party>
          <Seen>false</Seen>
          <SentLocal>String</SentLocal>
          <SentUtc>0001-01-01T00:00:00</SentUtc>
          <ViaVoice>false</ViaVoice>
          <Who>String</Who>
        </JobThreadMessageView>
      </Messages>
      <Note>String</Note>
      <QuickReplies xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </QuickReplies>
      <RefCode>String</RefCode>
      <RefId>0</RefId>
      <Unread>0</Unread>
      <Who>String</Who>
      <WorkerContactId>0</WorkerContactId>
    </JobThreadView>
  </Threads>
</CustomerThreadResponse>