Trendsic Platform Service

<back to all web services

IncomingCRMConversationRequest

The following routes are available for this service:
POST,OPTIONS/v1/conversation/crm/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 IncomingCRMConversationRequest extends SmsRequest implements IConvertible
{
    IncomingCRMConversationRequest();
    IncomingCRMConversationRequest.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() => "IncomingCRMConversationRequest";
    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()),
    'IncomingCRMConversationRequest': TypeInfo(TypeOf.Class, create:() => IncomingCRMConversationRequest()),
});

Dart IncomingCRMConversationRequest 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 /v1/conversation/crm/reply HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<SMSTwilioHookRoutes.IncomingCRMConversationRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AccountSid xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</AccountSid>
  <From xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</From>
  <FromCity xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</FromCity>
  <FromCountry xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</FromCountry>
  <FromState xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</FromState>
  <FromZip xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</FromZip>
  <To xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</To>
  <ToCity xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</ToCity>
  <ToCountry xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</ToCountry>
  <ToState xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</ToState>
  <ToZip xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</ToZip>
  <Body xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</Body>
  <MessageSid xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</MessageSid>
  <MessageStatus xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</MessageStatus>
  <MessagingServiceSid xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</MessagingServiceSid>
  <NumMedia xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">0</NumMedia>
  <OptOutType xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</OptOutType>
  <ReferralNumMedia xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">0</ReferralNumMedia>
  <SmsSid xmlns="http://schemas.datacontract.org/2004/07/Twilio.AspNet.Common">String</SmsSid>
</SMSTwilioHookRoutes.IncomingCRMConversationRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

(string)