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 datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OutboundCampaignResult:
    campaign_id: Optional[int] = None
    decisions: Optional[Dict[str, int]] = None
    queued_by_channel: Optional[Dict[str, int]] = None
    message_statuses: Optional[Dict[str, int]] = None
    duplicates: Optional[int] = None
    no_identity: Optional[int] = None
    status_code: Optional[int] = None
    message: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OutboundCampaignDevice:
    token: Optional[str] = None
    platform: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OutboundCampaignPerson:
    phone: Optional[str] = None
    email: Optional[str] = None
    devices: Optional[List[OutboundCampaignDevice]] = None
    push_consent: Optional[bool] = None
    sms_consent: Optional[bool] = None
    email_consent: Optional[bool] = None
    payload_json: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OutboundCampaignLaunchRequest:
    campaign_id: Optional[int] = None
    people: Optional[List[OutboundCampaignPerson]] = None

Python 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>