Trendsic Platform Service

<back to all web services

MessagingTestRequest

Requires Authentication
The following routes are available for this service:
POST/v1/messaging/test
import 'package:servicestack/servicestack.dart';

class MessagingTestSend implements IConvertible
{
    String? StepId;
    String? Status;
    String? Output;
    String? Body;
    int? Segments;
    int? SmsMessageId;

    MessagingTestSend({this.StepId,this.Status,this.Output,this.Body,this.Segments,this.SmsMessageId});
    MessagingTestSend.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        StepId = json['StepId'];
        Status = json['Status'];
        Output = json['Output'];
        Body = json['Body'];
        Segments = json['Segments'];
        SmsMessageId = json['SmsMessageId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'StepId': StepId,
        'Status': Status,
        'Output': Output,
        'Body': Body,
        'Segments': Segments,
        'SmsMessageId': SmsMessageId
    };

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

class MessagingTestResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<MessagingTestSend>? Sent = [];

    MessagingTestResponse({this.ResponseStatus,this.Sent});
    MessagingTestResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Sent = JsonConverters.fromJson(json['Sent'],'List<MessagingTestSend>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Sent': JsonConverters.toJson(Sent,'List<MessagingTestSend>',context!)
    };

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

class MessagingTestRequest implements IConvertible
{
    String? RuleKey;
    String? BranchId;
    String? LineId;
    List<String>? StepIds = [];
    String? ToPhone;
    bool? Remember;

    MessagingTestRequest({this.RuleKey,this.BranchId,this.LineId,this.StepIds,this.ToPhone,this.Remember});
    MessagingTestRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        RuleKey = json['RuleKey'];
        BranchId = json['BranchId'];
        LineId = json['LineId'];
        StepIds = JsonConverters.fromJson(json['StepIds'],'List<String>',context!);
        ToPhone = json['ToPhone'];
        Remember = json['Remember'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'RuleKey': RuleKey,
        'BranchId': BranchId,
        'LineId': LineId,
        'StepIds': JsonConverters.toJson(StepIds,'List<String>',context!),
        'ToPhone': ToPhone,
        'Remember': Remember
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'MessagingTestSend': TypeInfo(TypeOf.Class, create:() => MessagingTestSend()),
    'MessagingTestResponse': TypeInfo(TypeOf.Class, create:() => MessagingTestResponse()),
    'List<MessagingTestSend>': TypeInfo(TypeOf.Class, create:() => <MessagingTestSend>[]),
    'MessagingTestRequest': TypeInfo(TypeOf.Class, create:() => MessagingTestRequest()),
});

Dart MessagingTestRequest DTOs

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

HTTP + JSV

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

POST /v1/messaging/test HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	RuleKey: String,
	BranchId: 00000000000000000000000000000000,
	LineId: 00000000000000000000000000000000,
	StepIds: 
	[
		String
	],
	ToPhone: String,
	Remember: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Sent: 
	[
		{
			StepId: String,
			Status: String,
			Output: String,
			Body: String,
			Segments: 0,
			SmsMessageId: 0
		}
	]
}