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

{
	campaignId: 0,
	people: 
	[
		{
			phone: String,
			email: String,
			devices: 
			[
				{
					token: String,
					platform: String
				}
			],
			pushConsent: False,
			smsConsent: False,
			emailConsent: False,
			payloadJson: String
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	campaignId: 0,
	decisions: 
	{
		String: 0
	},
	queuedByChannel: 
	{
		String: 0
	},
	messageStatuses: 
	{
		String: 0
	},
	duplicates: 0,
	noIdentity: 0,
	statusCode: 0,
	message: String
}