This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Campaigns in ActiveCampaign



Overview

The following operations allow you to work with campaigns. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with campaigns, see Sample configuration

OperationDescription

createCampaign

Creates and sends a new campaign.

getCampaignClickersRetrieves all links and click data for a specific campaign.
listCampaignsRetrieves campaign settings and information.

Operation details

This section provides further details on the operations related to campaigns.

Creating a new campaign 

The createCampaign operation creates and sends a new campaign.

createCampaign
<activecampaign.createCampaign>
	<type>{$ctx:type}</type>
    <segmentId>{$ctx:segmentId}</segmentId>
    <name>{$ctx:name}</name>
    <sdate>{$ctx:sdate}</sdate>
    <isStatusScheduled>{$ctx:isStatusScheduled}</isStatusScheduled>
    <isPublic>{$ctx:isPublic}</isPublic>
    <trackLinks>{$ctx:trackLinks}</trackLinks>
    <isTrackLinksAnalyticsEnabled>{$ctx:isTrackLinksAnalyticsEnabled}</isTrackLinksAnalyticsEnabled>
    <isTrackReadsEnabled>{$ctx:isTrackReadsEnabled}</isTrackReadsEnabled>
    <isTrackRepliesEnabled>{$ctx:isTrackRepliesEnabled}</isTrackRepliesEnabled>
    <analyticsCampaignName>{$ctx:analyticsCampaignName}</analyticsCampaignName>
    <isTweetEnabled>{$ctx:isTweetEnabled}</isTweetEnabled>
    <isFacebookEnabled>{$ctx:isFacebookEnabled}</isFacebookEnabled>
    <isHtmlUnsubEnabled>{$ctx:isHtmlUnsubEnabled}</isHtmlUnsubEnabled>
    <isTextUnsubEnabled>{$ctx:isTextUnsubEnabled}</isTextUnsubEnabled>
    <htmlUnsubData>{$ctx:htmlUnsubData}</htmlUnsubData>
    <textUnsubData>{$ctx:textUnsubData}</textUnsubData>
    <recurring>{$ctx:recurring}</recurring>
    <splitType>{$ctx:splitType}</splitType>
    <splitOffset>{$ctx:splitOffset}</splitOffset>
    <splitOffsetType>{$ctx:splitOffsetType}</splitOffsetType>
    <responderOffset>{$ctx:responderOffset}</responderOffset>
    <responderType>{$ctx:responderType}</responderType>
    <reminderField>{$ctx:reminderField}</reminderField>
    <reminderFormat>{$ctx:reminderFormat}</reminderFormat>
    <reminderType>{$ctx:reminderType}</reminderType>
    <reminderOffset>{$ctx:reminderOffset}</reminderOffset>
    <reminderOffsetType>{$ctx:reminderOffsetType}</reminderOffsetType>
    <reminderOffsetSign>{$ctx:reminderOffsetSign}</reminderOffsetSign>
    <activerssInterval>{$ctx:activerssInterval}</activerssInterval>
    <linkUrlList>{$ctx:linkUrlList}</linkUrlList>
    <linkNameList>{$ctx:linkNameList}</linkNameList>
    <linkMessageList>{$ctx:linkMessageList}</linkMessageList>
    <listDetails>{$ctx:listDetails}</listDetails>
</activecampaign.createCampaign>
Properties
  • type: The type of the campaign.
  • segmentId: The list segment ID.
  • name: The internal campaign name.
  • sdate: The date when the campaign should be sent out.
  • isStatusScheduled: The status of the campaign.
  • isPublic: The visibility of the campaign to the public side.
  • trackLinks: The type of the links that should be tracked.
  • isTrackLinksAnalyticsEnabled: Whether to use the lists' Google Analytics settings.
  • isTrackReadsEnabled: Whether to track reads.
  • isTrackRepliesEnabled: Whether to track replies.
  • analyticsCampaignName: The name of this campaign to be used in Google Analytics.
  • isTweetEnabled: Whether to use lists' Twitter settings.
  • isFacebookEnabled: Whether to use lists' Facebook settings.
  • isHtmlUnsubEnabled: Whether to append the unsubscribe link to the bottom of the HTML body.
  • isTextUnsubEnabled: Whether to append the unsubscribe link to the bottom of the TEXT body.
  • htmlUnsubData: The custom unsubscribe link.
  • textUnsubData: The custom unsubscribe link.
  • recurring: The value for recurring mailing.
  • splitType: The type of the split mailing.
  • splitOffset: The value for waiting in split mailing.
  • splitOffsetType: The type for waiting in split mailing.
  • responderOffset: The value for waiting in auto responding.
  • responderType: The type for the auto responder - after what it should be sent.
  • reminderField: The contact field to be used in auto reminder.
  • reminderFormat: The format in which the date is represented in the contact field.
  • reminderType: The type for the auto reminder.
  • reminderOffset: The value for triggering the auto reminder.
  • reminderOffsetType: The type of the auto reminder.
  • reminderOffsetSign: The sign for the reminder offset which should be different.
  • activerssInterval: The value for ActiveRSS.
  • linkUrlList: The list of link URLs to track.
  • linkNameList: The list of link names to track.
  • linkMessageList: The list of link messages to track.
  • listDetails: The list details that are to be sent as Message IDs and List IDs.
Sample request

Following is a sample REST/JSON request that can be handled by the createCampaign operation.

Sample Request for createCampaign
{
  "apiKey": "e7956c7bb85755f12f13ecfc66d8ec3b822d54752ee836556b53c0fc356c2dec31f56fda",
  "apiUrl": "http://virtusax.api-us1.com",
  "apiOutput": "json",
  "type": "single",
  "name": "TestCampaign08",
  "sdate": "2015-01-31 08:40:00",
  "isStatusScheduled": "1",
  "isPublic": "1",
  "listDetails": {
    "p[1]": "1",
    "p[2]": "2",
    "m[6]": "100"
  },
  "trackLinks": "html",
  "segmentId": "1",
  "isTrackLinksAnalyticsEnabled": "1",
  "isTrackReadsEnabled": "1",
  "isTrackRepliesEnabled": "1",
  "analyticsCampaignName": "TestName",
  "isTweetEnabled": "1",
  "isFacebookEnabled": "1",
  "isHtmlUnsubEnabled": "1",
  "isTextUnsubEnabled": "1",
  "htmlUnsubData": "<div><a href='%UNSUBSCRIBELINK%'>Click here</a> to unsubscribe from future mailings.</div>",
  "textUnsubData": "Click here to unsubscribe from future mailings: %UNSUBSCRIBELINK%",
  "recurring": "day1",
  "splitType": "even",
  "splitOffset": "12",
  "splitOffsetType": "hour",
  "responderOffset": "12",
  "responderType": "subscribe",
  "reminderField": "2015-01-31 08:40:00",
  "reminderFormat": "yyyy-mm-dd",
  "reminderType": "month_day",
  "reminderOffset": "5",
  "reminderOffsetType": "day",
  "reminderOffsetSign": "+",
  "activerssInterval": "day1",
  "linkUrlList": [
    "http://www.google.com/"
  ],
  "linkNameList": [
    "Google Inc."
  ],
  "linkMessageList": [
    "6"
  ]
}
Related ActiveCampaign documentation

http://www.activecampaign.com/api/example.php?call=campaign_create

Retrieving all links and click data for a specific campaign

The getCampaignClickers operation retrieves all links and click data for a specific campaign.

getCampaignClickers
<activecampaign.getCampaignClickers>
    <campaignId>{$ctx:campaignId}</campaignId>
	<messageId>{$ctx:messageId}</messageId>
</activecampaign.getCampaignClickers>
Properties
  • campaignId: The ID of the campaign to see results.
  • messageId: The ID of the message.
Sample request

Following is a sample REST/JSON request that can be handled by the getCampaignClickers operation.

getCampaignClickers
{
   "apiUrl":"http://virasoft.api-us1.com",
   "apiKey":"24462e0fb3302378ae0fbd6ce6aa2574319975769049be0bd63934a426f5d5cdc39821a7",
   "apiOutput":"json",
   "campaignId":"2",
   "messageId":"4"
}
Related ActiveCampaign documentation

http://www.activecampaign.com/api/example.php?call=campaign_report_link_list

Retrieving campaign settings and information

The listCampaigns operation retrieves all campaign settings and information.

listCampaigns
<activecampaign.listCampaigns>
    <ids>{$ctx:ids}</ids>
    <nameFilter>{$ctx:nameFilter}</nameFilter>
    <typeFilter>{$ctx:typeFilter}</typeFilter>
    <createdSinceDateFilter>{$ctx:createdSinceDateFilter}</createdSinceDateFilter>
    <startedSinceDateFilter>{$ctx:startedSinceDateFilter}</startedSinceDateFilter>
    <lastSentSinceDateFilter>{$ctx:lastSentSinceDateFilter}</lastSentSinceDateFilter>
    <groupIdsFilter>{$ctx:groupIdsFilter}</groupIdsFilter>
    <isFull>{$ctx:isFull}</isFull>
    <sort>{$ctx:sort}</sort>
    <sortDirection>{$ctx:sortDirection}</sortDirection>
	<page>{$ctx:page}</page>
</activecampaign.listCampaigns>
Properties
  • ids: The comma separated list of campaign IDs you wish to view.
  • nameFilter: The state of accounts to return. The value can be "active" or "closed".
  • typeFilter: The type of the campaign such as "single", "recurring", "split", "responder", "reminder", "special", "activerss", or "text".
  • createdSinceDateFilter: Campaigns created since a certain date.
  • startedSinceDateFilter: Campaigns started since a certain date.
  • lastSentSinceDateFilter: Campaigns last sent since a certain date.
  • groupIdsFilter: Campaigns sent by users of a certain group.
  • isFull: Indicates whether to return ALL data. Set to "1" for ALL data, and "0" for abbreviated data.
  • sort: The field to sort on.
  • sortDirection: The direction to sort. Possible values: ASC or DESC.
  • page: The page number. Results are limited to 10 per page.
Sample request

Following is a sample REST/JSON request that can be handled by the listCampaigns operation.

listCampaigns
{
	"apiUrl":"http://wso2.api-us1.com",
	"apiKey":"eaae213ef1b8d842aba960423308c2e516d7704b95be8899fae897a1580a40e0a5cea198",
	"apiOutput":"json",
	"ids":"1,2,3",
	"nameFilter":"My",
	"typeFilter":"text",
	"createdSinceDateFilter":"2015-01-16",
	"startedSinceDateFilter":"2015-01-16",
	"lastSentSinceDateFilter":"2015-01-16",
	"groupIdsFilter":"",
	"isFull":"1",
	"sort":"id",
	"sortDirection":"ASC",
	"page":""
}
Related ActiveCampaign documentation

http://www.activecampaign.com/api/example.php?call=campaign_list

Sample configuration

Following is a sample proxy service that illustrates how to connect to ActiveCampaign with the init operation and use the createCampaign operation. The sample request for this proxy can be found in the createCampaign sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="activecampaign_createCampaign"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
         <property name="apiKey" expression="json-eval($.apiKey)"/>
         <property name="apiOutput" expression="json-eval($.apiOutput)"/>
         <property name="type" expression="json-eval($.type)"/>
         <property name="segmentId" expression="json-eval($.segmentId)"/>
         <property name="name" expression="json-eval($.name)"/>
         <property name="sdate" expression="json-eval($.sdate)"/>
         <property name="isStatusScheduled" expression="json-eval($.isStatusScheduled)"/>
         <property name="isPublic" expression="json-eval($.isPublic)"/>
         <property name="trackLinks" expression="json-eval($.trackLinks)"/>
         <property name="isTrackLinksAnalyticsEnabled" expression="json-eval($.isTrackLinksAnalyticsEnabled)"/>
         <property name="isTrackReadsEnabled" expression="json-eval($.isTrackReadsEnabled)"/>
         <property name="isTrackRepliesEnabled" expression="json-eval($.isTrackRepliesEnabled)"/>
         <property name="analyticsCampaignName" expression="json-eval($.analyticsCampaignName)"/>
         <property name="isTweetEnabled" expression="json-eval($.isTweetEnabled)"/>
         <property name="isFacebookEnabled" expression="json-eval($.isFacebookEnabled)"/>
         <property name="isHtmlUnsubEnabled" expression="json-eval($.isHtmlUnsubEnabled)"/>
         <property name="isTextUnsubEnabled" expression="json-eval($.isTextUnsubEnabled)"/>
         <property name="htmlUnsubData" expression="json-eval($.htmlUnsubData)"/>
         <property name="textUnsubData" expression="json-eval($.textUnsubData)"/>
         <property name="recurring" expression="json-eval($.recurring)"/>
         <property name="splitType" expression="json-eval($.splitType)"/>
         <property name="splitOffset" expression="json-eval($.splitOffset)"/>
         <property name="splitOffsetType" expression="json-eval($.splitOffsetType)"/>
         <property name="responderOffset" expression="json-eval($.responderOffset)"/>
         <property name="responderType" expression="json-eval($.responderType)"/>
         <property name="reminderField" expression="json-eval($.reminderField)"/>
         <property name="reminderFormat" expression="json-eval($.reminderFormat)"/>
         <property name="reminderType" expression="json-eval($.reminderType)"/>
         <property name="reminderOffset" expression="json-eval($.reminderOffset)"/>
         <property name="reminderOffsetType" expression="json-eval($.reminderOffsetType)"/>
         <property name="reminderOffsetSign" expression="json-eval($.reminderOffsetSign)"/>
         <property name="activerssInterval" expression="json-eval($.activerssInterval)"/>
         <property name="linkUrlList" expression="json-eval($.linkUrlList)"/>
         <property name="linkNameList" expression="json-eval($.linkNameList)"/>
         <property name="linkMessageList" expression="json-eval($.linkMessageList)"/>
         <property name="listDetails" expression="json-eval($.listDetails)"/>
         <activecampaign.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
            <apiOutput>{$ctx:apiOutput}</apiOutput>
         </activecampaign.init>
         <activecampaign.createCampaign>
            <type>{$ctx:type}</type>
            <segmentId>{$ctx:segmentId}</segmentId>
            <name>{$ctx:name}</name>
            <sdate>{$ctx:sdate}</sdate>
            <isStatusScheduled>{$ctx:isStatusScheduled}</isStatusScheduled>
            <isPublic>{$ctx:isPublic}</isPublic>
            <trackLinks>{$ctx:trackLinks}</trackLinks>
            <isTrackLinksAnalyticsEnabled>{$ctx:isTrackLinksAnalyticsEnabled}</isTrackLinksAnalyticsEnabled>
            <isTrackReadsEnabled>{$ctx:isTrackReadsEnabled}</isTrackReadsEnabled>
            <isTrackRepliesEnabled>{$ctx:isTrackRepliesEnabled}</isTrackRepliesEnabled>
            <analyticsCampaignName>{$ctx:analyticsCampaignName}</analyticsCampaignName>
            <isTweetEnabled>{$ctx:isTweetEnabled}</isTweetEnabled>
            <isFacebookEnabled>{$ctx:isFacebookEnabled}</isFacebookEnabled>
            <isHtmlUnsubEnabled>{$ctx:isHtmlUnsubEnabled}</isHtmlUnsubEnabled>
            <isTextUnsubEnabled>{$ctx:isTextUnsubEnabled}</isTextUnsubEnabled>
            <htmlUnsubData>{$ctx:htmlUnsubData}</htmlUnsubData>
            <textUnsubData>{$ctx:textUnsubData}</textUnsubData>
            <recurring>{$ctx:recurring}</recurring>
            <splitType>{$ctx:splitType}</splitType>
            <splitOffset>{$ctx:splitOffset}</splitOffset>
            <splitOffsetType>{$ctx:splitOffsetType}</splitOffsetType>
            <responderOffset>{$ctx:responderOffset}</responderOffset>
            <responderType>{$ctx:responderType}</responderType>
            <reminderField>{$ctx:reminderField}</reminderField>
            <reminderFormat>{$ctx:reminderFormat}</reminderFormat>
            <reminderType>{$ctx:reminderType}</reminderType>
            <reminderOffset>{$ctx:reminderOffset}</reminderOffset>
            <reminderOffsetType>{$ctx:reminderOffsetType}</reminderOffsetType>
            <reminderOffsetSign>{$ctx:reminderOffsetSign}</reminderOffsetSign>
            <activerssInterval>{$ctx:activerssInterval}</activerssInterval>
            <linkUrlList>{$ctx:linkUrlList}</linkUrlList>
            <linkNameList>{$ctx:linkNameList}</linkNameList>
            <linkMessageList>{$ctx:linkMessageList}</linkMessageList>
            <listDetails>{$ctx:listDetails}</listDetails>
         </activecampaign.createCampaign>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>