Evo Voice

<back to all web services

LiveAnswerCallback

The following routes are available for this service:
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>[]),
});

Dart LiveAnswerCallback 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.

POST /nodes/live-answer/callback HTTP/1.1 
Host: team.evovoice.io 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<LiveAnswerCallback xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Nodes.AI">
  <AIMinutes>0</AIMinutes>
  <Attachments>
    <LiveAnswerCallbackAttachment>
      <ContentType>String</ContentType>
      <Data>String</Data>
      <FileName>String</FileName>
      <Uri>String</Uri>
    </LiveAnswerCallbackAttachment>
  </Attachments>
  <ClientId>String</ClientId>
  <ConversationId>String</ConversationId>
  <EndDate>0001-01-01T00:00:00</EndDate>
  <FlowId>String</FlowId>
  <From>String</From>
  <NodeId>String</NodeId>
  <SessionId>String</SessionId>
  <StartDate>0001-01-01T00:00:00</StartDate>
  <To>String</To>
  <Transcript>
    <LiveAnswerCallbackTranscriptMessage>
      <Content>String</Content>
      <Date>0001-01-01T00:00:00</Date>
      <FunctionArgs>String</FunctionArgs>
      <FunctionName>String</FunctionName>
      <Role>String</Role>
      <SenderName>String</SenderName>
      <TargetName>String</TargetName>
    </LiveAnswerCallbackTranscriptMessage>
  </Transcript>
</LiveAnswerCallback>