Trendsic Platform Service

<back to all web services

IncomingConversationRequest

The following routes are available for this service:
POST,OPTIONS/v1/conversation/reply
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

abstract class TwilioRequest
{
    String? AccountSid;
    String? From;
    String? To;
    String? FromCity;
    String? FromState;
    String? FromZip;
    String? FromCountry;
    String? ToCity;
    String? ToState;
    String? ToZip;
    String? ToCountry;

    TwilioRequest({this.AccountSid,this.From,this.To,this.FromCity,this.FromState,this.FromZip,this.FromCountry,this.ToCity,this.ToState,this.ToZip,this.ToCountry});
    TwilioRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AccountSid = json['AccountSid'];
        From = json['From'];
        To = json['To'];
        FromCity = json['FromCity'];
        FromState = json['FromState'];
        FromZip = json['FromZip'];
        FromCountry = json['FromCountry'];
        ToCity = json['ToCity'];
        ToState = json['ToState'];
        ToZip = json['ToZip'];
        ToCountry = json['ToCountry'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AccountSid': AccountSid,
        'From': From,
        'To': To,
        'FromCity': FromCity,
        'FromState': FromState,
        'FromZip': FromZip,
        'FromCountry': FromCountry,
        'ToCity': ToCity,
        'ToState': ToState,
        'ToZip': ToZip,
        'ToCountry': ToCountry
    };

    getTypeName() => "TwilioRequest";
    TypeContext? context = _ctx;
}

class SmsRequest extends TwilioRequest implements IConvertible
{
    String? MessageSid;
    String? SmsSid;
    String? Body;
    String? MessageStatus;
    String? OptOutType;
    String? MessagingServiceSid;
    int? NumMedia;
    int? ReferralNumMedia;

    SmsRequest({this.MessageSid,this.SmsSid,this.Body,this.MessageStatus,this.OptOutType,this.MessagingServiceSid,this.NumMedia,this.ReferralNumMedia});
    SmsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        MessageSid = json['MessageSid'];
        SmsSid = json['SmsSid'];
        Body = json['Body'];
        MessageStatus = json['MessageStatus'];
        OptOutType = json['OptOutType'];
        MessagingServiceSid = json['MessagingServiceSid'];
        NumMedia = json['NumMedia'];
        ReferralNumMedia = json['ReferralNumMedia'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'MessageSid': MessageSid,
        'SmsSid': SmsSid,
        'Body': Body,
        'MessageStatus': MessageStatus,
        'OptOutType': OptOutType,
        'MessagingServiceSid': MessagingServiceSid,
        'NumMedia': NumMedia,
        'ReferralNumMedia': ReferralNumMedia
    });

    getTypeName() => "SmsRequest";
    TypeContext? context = _ctx;
}

class IncomingConversationRequest extends SmsRequest implements IConvertible
{
    IncomingConversationRequest();
    IncomingConversationRequest.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "IncomingConversationRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'TwilioRequest': TypeInfo(TypeOf.AbstractClass),
    'SmsRequest': TypeInfo(TypeOf.Class, create:() => SmsRequest()),
    'IncomingConversationRequest': TypeInfo(TypeOf.Class, create:() => IncomingConversationRequest()),
});

Dart IncomingConversationRequest DTOs

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

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/conversation/reply HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"MessageSid":"String","SmsSid":"String","Body":"String","MessageStatus":"String","OptOutType":"String","MessagingServiceSid":"String","NumMedia":0,"ReferralNumMedia":0,"AccountSid":"String","From":"String","To":"String","FromCity":"String","FromState":"String","FromZip":"String","FromCountry":"String","ToCity":"String","ToState":"String","ToZip":"String","ToCountry":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

(string)