Loading...

POST   https://api.3seventy.com/api/v2.1/account/{accountId}/campaign

Description

Create new campaign

Path Parameters

accountId integer The ID of the account to create the campaign under. required

Request Properties application/json

SubscriptionId integer The subscription that contacts who respond to this campaign are opted into.. optional
Name string The campaigns name required
CampaignTypeId number The type of campaign required
ContentId integer Content that this campaign sends. optional
Content object Content to add to this campaign. optional
UserData string Arbitrary user data field optional
SingleUse boolean This Flag is for checking Single Send Campaign. optional
SingleUseContentId integer This is set to the content Id for Single Send Campaign response. optional
Links array[object] A list of links to create along with this campaign. optional
IsDefault boolean Indicates if its a default campaign optional


                    

Response Properties application/json

Id integer The unique ID of the campaign
AccountId integer The account to which the campaign belongs.
SubscriptionId integer The subscription that contacts who respond to this campaign are opted into.
Name string The campaigns name
CampaignTypeId number The type of campaign
StatusId number The current status the campaign is in.
StatusReason string Human readable status
ContentId integer Content that this campaign sends.
Session integer Indicates if this campaign will start a new session
SessionLength integer The durration of sessions in miliseconds from start.
UserData string Arbitrary user data field.
Created string When this campaign was created
Modified string When this campaign was last modified
CreatedBy string Who created the campaign
ModifiedBy string Who last modified the campaign.
SingleUse boolean This flag is for checking single send campaign.
SingleUseContentId integer This is set to the content id for response to send when the campaign is used more than once.


                    

C#


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using ThreeSeventy.Vector.Client;
using ThreeSeventy.Vector.Client.Enums;
using ThreeSeventy.Vector.Client.Models;

public class Program
{

private static void Main(string[] args)
{

const int accountId = XXXX;

const int subscriptionId = XXXX;

const int contentId = XXXX;

var context = new T70Context();

var campaign = new Campaign

{

Name = "SDK Test Campaign",

SubscriptionId = subscriptionId,

CampaignType = CampaignType.Basic,

ContentId = contentId

};

var campaignRepo = context.Repository<Campaign>(new { AccountId = accountId });

campaignRepo.Add(campaign);

}

}