TicketUserServices

<back to all web services

OutboundEnqueueBatchRequest

Requires Authentication
Required role:Admin
The following routes are available for this service:
POST/Outbound/EnqueueBatch
import 'package:servicestack/servicestack.dart';

class OutboundEnqueueBatchRejection implements IConvertible
{
    int? index;
    String? dedupKey;
    String? reason;

    OutboundEnqueueBatchRejection({this.index,this.dedupKey,this.reason});
    OutboundEnqueueBatchRejection.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        index = json['index'];
        dedupKey = json['dedupKey'];
        reason = json['reason'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'index': index,
        'dedupKey': dedupKey,
        'reason': reason
    };

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

class OutboundEnqueueBatchResult implements IConvertible
{
    int? enqueued;
    int? duplicate;
    int? rejected;
    List<OutboundEnqueueBatchRejection>? rejections;
    int? statusCode;
    String? message;

    OutboundEnqueueBatchResult({this.enqueued,this.duplicate,this.rejected,this.rejections,this.statusCode,this.message});
    OutboundEnqueueBatchResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        enqueued = json['enqueued'];
        duplicate = json['duplicate'];
        rejected = json['rejected'];
        rejections = JsonConverters.fromJson(json['rejections'],'List<OutboundEnqueueBatchRejection>',context!);
        statusCode = json['statusCode'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'enqueued': enqueued,
        'duplicate': duplicate,
        'rejected': rejected,
        'rejections': JsonConverters.toJson(rejections,'List<OutboundEnqueueBatchRejection>',context!),
        'statusCode': statusCode,
        'message': message
    };

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

class OutboundEnqueueRequest implements IConvertible
{
    String? channel;
    String? lane;
    int? priority;
    String? address;
    String? platform;
    String? recipientKey;
    String? templateKey;
    String? language;
    String? payloadJson;
    String? dedupKey;
    int? campaignId;
    int? ownerId;
    String? guardKey;
    String? guardSubject;
    DateTime? notBefore;
    DateTime? expiresAt;

    OutboundEnqueueRequest({this.channel,this.lane,this.priority,this.address,this.platform,this.recipientKey,this.templateKey,this.language,this.payloadJson,this.dedupKey,this.campaignId,this.ownerId,this.guardKey,this.guardSubject,this.notBefore,this.expiresAt});
    OutboundEnqueueRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        channel = json['channel'];
        lane = json['lane'];
        priority = json['priority'];
        address = json['address'];
        platform = json['platform'];
        recipientKey = json['recipientKey'];
        templateKey = json['templateKey'];
        language = json['language'];
        payloadJson = json['payloadJson'];
        dedupKey = json['dedupKey'];
        campaignId = json['campaignId'];
        ownerId = json['ownerId'];
        guardKey = json['guardKey'];
        guardSubject = json['guardSubject'];
        notBefore = JsonConverters.fromJson(json['notBefore'],'DateTime',context!);
        expiresAt = JsonConverters.fromJson(json['expiresAt'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'channel': channel,
        'lane': lane,
        'priority': priority,
        'address': address,
        'platform': platform,
        'recipientKey': recipientKey,
        'templateKey': templateKey,
        'language': language,
        'payloadJson': payloadJson,
        'dedupKey': dedupKey,
        'campaignId': campaignId,
        'ownerId': ownerId,
        'guardKey': guardKey,
        'guardSubject': guardSubject,
        'notBefore': JsonConverters.toJson(notBefore,'DateTime',context!),
        'expiresAt': JsonConverters.toJson(expiresAt,'DateTime',context!)
    };

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

class OutboundEnqueueBatchRequest implements IConvertible
{
    List<OutboundEnqueueRequest>? messages;

    OutboundEnqueueBatchRequest({this.messages});
    OutboundEnqueueBatchRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'OutboundEnqueueBatchRejection': TypeInfo(TypeOf.Class, create:() => OutboundEnqueueBatchRejection()),
    'OutboundEnqueueBatchResult': TypeInfo(TypeOf.Class, create:() => OutboundEnqueueBatchResult()),
    'List<OutboundEnqueueBatchRejection>': TypeInfo(TypeOf.Class, create:() => <OutboundEnqueueBatchRejection>[]),
    'OutboundEnqueueRequest': TypeInfo(TypeOf.Class, create:() => OutboundEnqueueRequest()),
    'OutboundEnqueueBatchRequest': TypeInfo(TypeOf.Class, create:() => OutboundEnqueueBatchRequest()),
    'List<OutboundEnqueueRequest>': TypeInfo(TypeOf.Class, create:() => <OutboundEnqueueRequest>[]),
});

Dart OutboundEnqueueBatchRequest 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 /Outbound/EnqueueBatch HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"messages":[{"channel":"String","lane":"String","priority":0,"address":"String","platform":"String","recipientKey":"String","templateKey":"String","language":"String","payloadJson":"String","dedupKey":"String","campaignId":0,"ownerId":0,"guardKey":"String","guardSubject":"String","notBefore":"0001-01-01T00:00:00.0000000","expiresAt":"0001-01-01T00:00:00.0000000"}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"enqueued":0,"duplicate":0,"rejected":0,"rejections":[{"index":0,"dedupKey":"String","reason":"String"}],"statusCode":0,"message":"String"}