All Verbs | /nodes/live-answer/callback |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class LiveAnswerCallbackTranscriptMessage implements IConvertible
{
DateTime? date;
String? role;
String? senderName;
String? targetName;
String? functionName;
String? functionArgs;
String? content;
LiveAnswerCallbackTranscriptMessage({this.date,this.role,this.senderName,this.targetName,this.functionName,this.functionArgs,this.content});
LiveAnswerCallbackTranscriptMessage.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
date = JsonConverters.fromJson(json['date'],'DateTime',context!);
role = json['role'];
senderName = json['senderName'];
targetName = json['targetName'];
functionName = json['functionName'];
functionArgs = json['functionArgs'];
content = json['content'];
return this;
}
Map<String, dynamic> toJson() => {
'date': JsonConverters.toJson(date,'DateTime',context!),
'role': role,
'senderName': senderName,
'targetName': targetName,
'functionName': functionName,
'functionArgs': functionArgs,
'content': content
};
getTypeName() => "LiveAnswerCallbackTranscriptMessage";
TypeContext? context = _ctx;
}
class LiveAnswerCallbackAttachment implements IConvertible
{
String? fileName;
String? contentType;
String? uri;
String? data;
LiveAnswerCallbackAttachment({this.fileName,this.contentType,this.uri,this.data});
LiveAnswerCallbackAttachment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
fileName = json['fileName'];
contentType = json['contentType'];
uri = json['uri'];
data = json['data'];
return this;
}
Map<String, dynamic> toJson() => {
'fileName': fileName,
'contentType': contentType,
'uri': uri,
'data': data
};
getTypeName() => "LiveAnswerCallbackAttachment";
TypeContext? context = _ctx;
}
class LiveAnswerCallback implements IConvertible
{
String? sessionId;
String? flowId;
String? nodeId;
String? clientId;
String? conversationId;
int? aiMinutes;
String? from;
String? to;
List<LiveAnswerCallbackTranscriptMessage>? transcript;
DateTime? startDate;
DateTime? endDate;
List<LiveAnswerCallbackAttachment>? attachments;
LiveAnswerCallback({this.sessionId,this.flowId,this.nodeId,this.clientId,this.conversationId,this.aiMinutes,this.from,this.to,this.transcript,this.startDate,this.endDate,this.attachments});
LiveAnswerCallback.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
sessionId = json['sessionId'];
flowId = json['flowId'];
nodeId = json['nodeId'];
clientId = json['clientId'];
conversationId = json['conversationId'];
aiMinutes = json['aiMinutes'];
from = json['from'];
to = json['to'];
transcript = JsonConverters.fromJson(json['transcript'],'List<LiveAnswerCallbackTranscriptMessage>',context!);
startDate = JsonConverters.fromJson(json['startDate'],'DateTime',context!);
endDate = JsonConverters.fromJson(json['endDate'],'DateTime',context!);
attachments = JsonConverters.fromJson(json['attachments'],'List<LiveAnswerCallbackAttachment>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'sessionId': sessionId,
'flowId': flowId,
'nodeId': nodeId,
'clientId': clientId,
'conversationId': conversationId,
'aiMinutes': aiMinutes,
'from': from,
'to': to,
'transcript': JsonConverters.toJson(transcript,'List<LiveAnswerCallbackTranscriptMessage>',context!),
'startDate': JsonConverters.toJson(startDate,'DateTime',context!),
'endDate': JsonConverters.toJson(endDate,'DateTime',context!),
'attachments': JsonConverters.toJson(attachments,'List<LiveAnswerCallbackAttachment>',context!)
};
getTypeName() => "LiveAnswerCallback";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'team.evovoice.io', types: <String, TypeInfo> {
'LiveAnswerCallbackTranscriptMessage': TypeInfo(TypeOf.Class, create:() => LiveAnswerCallbackTranscriptMessage()),
'LiveAnswerCallbackAttachment': TypeInfo(TypeOf.Class, create:() => LiveAnswerCallbackAttachment()),
'LiveAnswerCallback': TypeInfo(TypeOf.Class, create:() => LiveAnswerCallback()),
'List<LiveAnswerCallbackTranscriptMessage>': TypeInfo(TypeOf.Class, create:() => <LiveAnswerCallbackTranscriptMessage>[]),
'List<LiveAnswerCallbackAttachment>': TypeInfo(TypeOf.Class, create:() => <LiveAnswerCallbackAttachment>[]),
});
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 /nodes/live-answer/callback HTTP/1.1
Host: team.evovoice.io
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"sessionId":"String","flowId":"String","nodeId":"String","clientId":"String","conversationId":"String","aiMinutes":0,"from":"String","to":"String","transcript":[{"date":"\/Date(-62135596800000-0000)\/","role":"String","senderName":"String","targetName":"String","functionName":"String","functionArgs":"String","content":"String"}],"startDate":"\/Date(-62135596800000-0000)\/","endDate":"\/Date(-62135596800000-0000)\/","attachments":[{"fileName":"String","contentType":"String","uri":"String","data":"String"}]}