| Required role: | Admin |
| 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;
int? suppressed;
List<OutboundEnqueueBatchRejection>? rejections;
int? statusCode;
String? message;
OutboundEnqueueBatchResult({this.enqueued,this.duplicate,this.rejected,this.suppressed,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'];
suppressed = json['suppressed'];
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,
'suppressed': suppressed,
'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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<OutboundEnqueueBatchRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Messages>
<OutboundEnqueueRequest>
<Address>String</Address>
<CampaignId>0</CampaignId>
<Channel>String</Channel>
<DedupKey>String</DedupKey>
<ExpiresAt>0001-01-01T00:00:00</ExpiresAt>
<GuardKey>String</GuardKey>
<GuardSubject>String</GuardSubject>
<Lane>String</Lane>
<Language>String</Language>
<NotBefore>0001-01-01T00:00:00</NotBefore>
<OwnerId>0</OwnerId>
<PayloadJson>String</PayloadJson>
<Platform>String</Platform>
<Priority>0</Priority>
<RecipientKey>String</RecipientKey>
<TemplateKey>String</TemplateKey>
</OutboundEnqueueRequest>
</Messages>
</OutboundEnqueueBatchRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<OutboundEnqueueBatchResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Duplicate>0</Duplicate>
<Enqueued>0</Enqueued>
<Message>String</Message>
<Rejected>0</Rejected>
<Rejections>
<OutboundEnqueueBatchRejection>
<DedupKey>String</DedupKey>
<Index>0</Index>
<Reason>String</Reason>
</OutboundEnqueueBatchRejection>
</Rejections>
<StatusCode>0</StatusCode>
<Suppressed>0</Suppressed>
</OutboundEnqueueBatchResult>