TicketUserServices

<back to all web services

OutboundCampaignLaunchRequest

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

class OutboundCampaignResult implements IConvertible
{
    int? campaignId;
    Map<String,int?>? decisions;
    Map<String,int?>? queuedByChannel;
    Map<String,int?>? messageStatuses;
    int? duplicates;
    int? noIdentity;
    int? statusCode;
    String? message;

    OutboundCampaignResult({this.campaignId,this.decisions,this.queuedByChannel,this.messageStatuses,this.duplicates,this.noIdentity,this.statusCode,this.message});
    OutboundCampaignResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        campaignId = json['campaignId'];
        decisions = JsonConverters.fromJson(json['decisions'],'Map<String,int?>',context!);
        queuedByChannel = JsonConverters.fromJson(json['queuedByChannel'],'Map<String,int?>',context!);
        messageStatuses = JsonConverters.fromJson(json['messageStatuses'],'Map<String,int?>',context!);
        duplicates = json['duplicates'];
        noIdentity = json['noIdentity'];
        statusCode = json['statusCode'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'campaignId': campaignId,
        'decisions': JsonConverters.toJson(decisions,'Map<String,int?>',context!),
        'queuedByChannel': JsonConverters.toJson(queuedByChannel,'Map<String,int?>',context!),
        'messageStatuses': JsonConverters.toJson(messageStatuses,'Map<String,int?>',context!),
        'duplicates': duplicates,
        'noIdentity': noIdentity,
        'statusCode': statusCode,
        'message': message
    };

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

class OutboundCampaignDevice implements IConvertible
{
    String? token;
    String? platform;

    OutboundCampaignDevice({this.token,this.platform});
    OutboundCampaignDevice.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        token = json['token'];
        platform = json['platform'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'token': token,
        'platform': platform
    };

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

class OutboundCampaignPerson implements IConvertible
{
    String? phone;
    String? email;
    List<OutboundCampaignDevice>? devices;
    bool? pushConsent;
    bool? smsConsent;
    bool? emailConsent;
    String? payloadJson;

    OutboundCampaignPerson({this.phone,this.email,this.devices,this.pushConsent,this.smsConsent,this.emailConsent,this.payloadJson});
    OutboundCampaignPerson.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        phone = json['phone'];
        email = json['email'];
        devices = JsonConverters.fromJson(json['devices'],'List<OutboundCampaignDevice>',context!);
        pushConsent = json['pushConsent'];
        smsConsent = json['smsConsent'];
        emailConsent = json['emailConsent'];
        payloadJson = json['payloadJson'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'phone': phone,
        'email': email,
        'devices': JsonConverters.toJson(devices,'List<OutboundCampaignDevice>',context!),
        'pushConsent': pushConsent,
        'smsConsent': smsConsent,
        'emailConsent': emailConsent,
        'payloadJson': payloadJson
    };

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

class OutboundCampaignLaunchRequest implements IConvertible
{
    int? campaignId;
    List<OutboundCampaignPerson>? people;

    OutboundCampaignLaunchRequest({this.campaignId,this.people});
    OutboundCampaignLaunchRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
    'OutboundCampaignResult': TypeInfo(TypeOf.Class, create:() => OutboundCampaignResult()),
    'Map<String,int?>': TypeInfo(TypeOf.Class, create:() => Map<String,int?>()),
    'OutboundCampaignDevice': TypeInfo(TypeOf.Class, create:() => OutboundCampaignDevice()),
    'OutboundCampaignPerson': TypeInfo(TypeOf.Class, create:() => OutboundCampaignPerson()),
    'List<OutboundCampaignDevice>': TypeInfo(TypeOf.Class, create:() => <OutboundCampaignDevice>[]),
    'OutboundCampaignLaunchRequest': TypeInfo(TypeOf.Class, create:() => OutboundCampaignLaunchRequest()),
    'List<OutboundCampaignPerson>': TypeInfo(TypeOf.Class, create:() => <OutboundCampaignPerson>[]),
});

Dart OutboundCampaignLaunchRequest 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 /Outbound/Campaigns/{CampaignId}/Launch HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<OutboundCampaignLaunchRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <CampaignId>0</CampaignId>
  <People>
    <OutboundCampaignPerson>
      <Devices>
        <OutboundCampaignDevice>
          <Platform>String</Platform>
          <Token>String</Token>
        </OutboundCampaignDevice>
      </Devices>
      <Email>String</Email>
      <EmailConsent>false</EmailConsent>
      <PayloadJson>String</PayloadJson>
      <Phone>String</Phone>
      <PushConsent>false</PushConsent>
      <SmsConsent>false</SmsConsent>
    </OutboundCampaignPerson>
  </People>
</OutboundCampaignLaunchRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<OutboundCampaignResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <CampaignId>0</CampaignId>
  <Decisions xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringint>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>0</d2p1:Value>
    </d2p1:KeyValueOfstringint>
  </Decisions>
  <Duplicates>0</Duplicates>
  <Message>String</Message>
  <MessageStatuses xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringint>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>0</d2p1:Value>
    </d2p1:KeyValueOfstringint>
  </MessageStatuses>
  <NoIdentity>0</NoIdentity>
  <QueuedByChannel xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringint>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>0</d2p1:Value>
    </d2p1:KeyValueOfstringint>
  </QueuedByChannel>
  <StatusCode>0</StatusCode>
</OutboundCampaignResult>