Loading...

POST   https://api.3seventy.com/api/v2.1/account/{accountId}/action-pushCampaign

Description

Creates a new push action

Path Parameters

accountId integer The account Id which owns the action. required

Request Properties application/json

Channels array[string] The channels to send the campaign on. required
Targets array[string] A list of targets to send to. These can be a mix of phone numbers, emails, or contact IDs. optional
TargetsUrl string A URL pointing to a list of targets to send to. optional
ContactListIds array[integer] A contact lists to push to. optional
ExcludeListIds array[integer] A contact lists to suppress from contact list. optional
CampaignId integer The campaign to push. required
MediaId integer The media file to push optional
Message string Required if campaign type is basic. Forbidden when not basic. optional
From string Used for email channel. Can specify From address or default will be used. optional
Subject string Subject of the email optional
IgnoreSingleUse boolean Check if the event is Single Use Push Event. optional
ForceOptIn boolean Opt an existing contact into the subscription if opted out optional
Schedules array[object] The list of schedules associated with the action optional
Execute boolean Set true if the action should be executed on creation optional
  {
    "Channels": [
       "+15125467903"
    ],
    "Targets": [],
    "TargetsUrl": "",
    "TargetsColumn": "",
    "ContactListIds": [
      3986
    ],
    "ExcludeListIds": [],
    "CampaignId": 22476,
    "MediaId": null,
    "Message": "Test SC",
    "IgnoreSingleUse": false,
    "ForceOptIn": false,
    "AccountId": 43510
  }

Response Properties application/json

Channels array[string] The channels to send the campaign on.
Targets array[string] A list of targets to send to. These can be a mix of phone numbers, emails, or contact IDs.
TargetsUrl string A URL pointing to a list of targets to send to.
ContactListIds array[int] The contact list IDs that the campaign was pushed to.
ExcludeListIds array[int] A contact lists to suppress from contacts to push to.
CampaignId integer The ID of the campaign that was pushed.
MediaId integer The ID of the media file that was pushed
Message string Optional message pushed out. (BASIC Campaigns only)
From string From Address for email channel
Subject string Subject of the email.
IgnoreSingleUse boolean Check if the event is Single Use Push Event.
ForceOptIn boolean Opt an existing contact into the subscription if opted out
StatusId number Status of an action
  {
    "Channels": [
     "+15125467903"
    ],
    "Targets": [],
    "TargetsUrl": "",
    "TargetsColumn": "",
    "ContactListIds": [
      3986
    ],
    "ExcludeListIds": [],
    "CampaignId": 22476,
    "MediaId": null,
    "Message": "Test SC",
    "From": "",
    "Subject": "",
    "IgnoreSingleUse": false,
    "ForceOptIn": false,
    "StatusId": 0,
    "Status": "Active",
    "AccountId": 43510,
    "Created": "2018-06-20T09:39:07",
    "Modified": "2018-06-20T09:39:07",
    "CreatedBy": "Integraton_User_1",
    "ModifiedBy": "",
    "Schedules": []
  }

C#


using System;
using System.Collections.Generic;
using ThreeSeventy.Vector.Client;
using ThreeSeventy.Vector.Client.Models;

 

class Program
{

           static void Main(string[] args)

            {

       const string accountId = "XXXXXXXXXXXXXXXX";

       const int campaignId = XXXX;

       int[] channelIds = {XXX};

       string[] targets = { "XXX"}

       var context = new T70Context();

       var actionPushRepo = context.Repository<ActionPushCampaign>(new { AccountId = accountId });     

                var pushEvent = new ActionPushCampaign

{

CampaignId = campaignId ,

Channels = channelIds , // You can push to several channels in one go if you wish.

Targets = targets , // Note that is possible to send to more than one target at a time.

Execute = true

};

actionPushRepo.Add(pushEvent);

Console.WriteLine("Sent campaign {0} to channel(s) {1}", campaignId , String.Join(", ", pushEvent.Channels));

    }

}