Required role: | User |
GET | /sessions/{sessionId}/transcript |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class ChatTranscriptMessage implements IConvertible
{
String? date;
String? from;
String? body;
String? mediaUri;
String? mediaContentType;
ChatTranscriptMessage({this.date,this.from,this.body,this.mediaUri,this.mediaContentType});
ChatTranscriptMessage.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
date = json['date'];
from = json['from'];
body = json['body'];
mediaUri = json['mediaUri'];
mediaContentType = json['mediaContentType'];
return this;
}
Map<String, dynamic> toJson() => {
'date': date,
'from': from,
'body': body,
'mediaUri': mediaUri,
'mediaContentType': mediaContentType
};
getTypeName() => "ChatTranscriptMessage";
TypeContext? context = _ctx;
}
class GetChatTranscriptResponse implements IConvertible
{
List<ChatTranscriptMessage>? messages;
GetChatTranscriptResponse({this.messages});
GetChatTranscriptResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
messages = JsonConverters.fromJson(json['messages'],'List<ChatTranscriptMessage>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'messages': JsonConverters.toJson(messages,'List<ChatTranscriptMessage>',context!)
};
getTypeName() => "GetChatTranscriptResponse";
TypeContext? context = _ctx;
}
/**
* Gets the specified transcript
*/
// @Api(Description="Gets the specified transcript")
class GetChatTranscript implements IGet, IConvertible
{
/**
* the session whose transcript you want to get
*/
// @ApiMember(Description="the session whose transcript you want to get")
String? sessionId;
/**
* Include previous messages from this chat party
*/
// @ApiMember(Description="Include previous messages from this chat party")
bool? includeHistorical;
/**
* How far back to include in historical messages. Max 6 months in past
*/
// @ApiMember(Description="How far back to include in historical messages. Max 6 months in past")
String? historicalCutOffDate;
GetChatTranscript({this.sessionId,this.includeHistorical,this.historicalCutOffDate});
GetChatTranscript.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
sessionId = json['sessionId'];
includeHistorical = json['includeHistorical'];
historicalCutOffDate = json['historicalCutOffDate'];
return this;
}
Map<String, dynamic> toJson() => {
'sessionId': sessionId,
'includeHistorical': includeHistorical,
'historicalCutOffDate': historicalCutOffDate
};
getTypeName() => "GetChatTranscript";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'team.evovoice.io', types: <String, TypeInfo> {
'ChatTranscriptMessage': TypeInfo(TypeOf.Class, create:() => ChatTranscriptMessage()),
'GetChatTranscriptResponse': TypeInfo(TypeOf.Class, create:() => GetChatTranscriptResponse()),
'List<ChatTranscriptMessage>': TypeInfo(TypeOf.Class, create:() => <ChatTranscriptMessage>[]),
'GetChatTranscript': TypeInfo(TypeOf.Class, create:() => GetChatTranscript()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /sessions/{sessionId}/transcript HTTP/1.1 Host: team.evovoice.io Accept: text/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"messages":[{"date":"String","from":"String","body":"String","mediaUri":"String","mediaContentType":"String"}]}