| POST | /v1/c/thread/{Kind}/{RefId} |
|---|
"use strict";
export class JobThreadMessageView {
/** @param {{Id?:number,Party?:string,Mine?:boolean,Who?:string,Body?:string,ViaVoice?:boolean,IsStatusChip?:boolean,ChipKey?:string,SentUtc?:string,SentLocal?:string,Seen?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
Party;
/** @type {boolean} */
Mine;
/** @type {string} */
Who;
/** @type {string} */
Body;
/** @type {boolean} */
ViaVoice;
/** @type {boolean} */
IsStatusChip;
/** @type {string} */
ChipKey;
/** @type {string} */
SentUtc;
/** @type {string} */
SentLocal;
/** @type {boolean} */
Seen;
}
export class JobThreadView {
/** @param {{Id?:number,Kind?:string,RefId?:number,RefCode?:string,WorkerContactId?:number,Who?:string,Closed?:boolean,ClosesLocal?:string,Unread?:number,Note?:string,QuickReplies?:string[],Messages?:JobThreadMessageView[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/** @type {string} */
Kind;
/** @type {number} */
RefId;
/** @type {string} */
RefCode;
/** @type {number} */
WorkerContactId;
/** @type {string} */
Who;
/** @type {boolean} */
Closed;
/** @type {string} */
ClosesLocal;
/** @type {number} */
Unread;
/** @type {string} */
Note;
/** @type {string[]} */
QuickReplies = [];
/** @type {JobThreadMessageView[]} */
Messages = [];
}
export class ProblemReasonView {
/** @param {{Key?:string,Label?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Key;
/** @type {string} */
Label;
}
export class CustomerThreadResponse {
/** @param {{Threads?:JobThreadView[],ProblemReasons?:ProblemReasonView[],Message?:string,ResponseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {JobThreadView[]} */
Threads = [];
/** @type {ProblemReasonView[]} */
ProblemReasons = [];
/** @type {string} */
Message;
/** @type {ResponseStatus} */
ResponseStatus;
}
export class CustomerThreadPostRequest {
/** @param {{Kind?:string,RefId?:number,WorkerContactId?:number,Body?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Kind;
/** @type {number} */
RefId;
/** @type {number} */
WorkerContactId;
/** @type {string} */
Body;
}
JavaScript CustomerThreadPostRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/c/thread/{Kind}/{RefId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Kind":"String","RefId":0,"WorkerContactId":0,"Body":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"Threads":[{"Id":0,"Kind":"String","RefId":0,"RefCode":"String","WorkerContactId":0,"Who":"String","Closed":false,"ClosesLocal":"String","Unread":0,"Note":"String","QuickReplies":["String"],"Messages":[{"Id":0,"Party":"String","Mine":false,"Who":"String","Body":"String","ViaVoice":false,"IsStatusChip":false,"ChipKey":"String","SentUtc":"0001-01-01T00:00:00.0000000","SentLocal":"String","Seen":false}]}],"ProblemReasons":[{"Key":"String","Label":"String"}],"Message":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}