Evo Voice

<back to all web services

GetChatTranscript

Gets the specified transcript

Requires Authentication
Required role:User
The following routes are available for this service:
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: '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()),
});

Dart GetChatTranscript DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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: evovoice.io 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"messages":[{"date":"String","from":"String","body":"String","mediaUri":"String","mediaContentType":"String"}]}