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



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 .

For more details click Campaigns.

OperationDescription
createACampaign Creates a new campaign.
updateACampaignUpdates an existing campaign.
getAllCampaignsRetrieves all campaigns.
getACampaign Retrieves the details of a campaign specified the campaign id.
getRecentCampaigns Retrieves subscribed email groups of a campaign specified by the campaign id.
deleteACampaignDeletes a campaign associated with the specified campaign id.

Operation Details

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

Create A Campaign

The createACampaign operation creates a new campaign.

createACampaign
<eloquaStandardAPI.createACampaign>
    <startAt>1284079044</startAt>
    <endAt>1284079049</endAt>
    <budgetedCost>1.0</budgetedCost>
    <actualCost>1.1</actualCost>
    <budgetedCostactualCostname>new campaign</name>
    <isMemberAllowedReEntry>true</isMemberAllowedReEntry>
    <fieldValues>[{"id": "5","value": "new value 234"}]</fieldValues>
    <elements></elements>
    <isReadOnly>false</isReadOnly>
    <campaignType></campaignType>
    <isReadOnlycampaignTypeproduct></product>
    <region></region>
    <isReadOnlycampaignTypeproductregioncrmId></crmId>
    <isSyncedWithCRM>true</isSyncedWithCRM>
    <isIncludedInROI>true</isIncludedInROI>
</eloquaStandardAPI.createACampaign>
properties
  • startAt                : Date time value of the campaign start.

  • endAt                  : Date time value of the campaign end.

  • budgetedCost           : Budgeted cost for the campaign.

  • actualCost             : Actual cost of the campaign.

  • name                   : Name of the campaign to create a campaign on this name.

  • isMemberAllowedReEntry : Boolean value, to set change permission to current user for this campaign.

  • fieldValues            : The array of the custom fields.

  • elements               : The email and segment elements for this campaign.

  • isReadOnly             : Boolean value, to set write permission to current user for this campaign.

  • campaignType            : The type of the campaign.

  • product                : The product of the campaign.

  • region                  : The region of the campaign.

  • crmId                   : The identifier of CRM.

  • isSyncedWithCRM        : This indicates whether this campaign ins synced with CRM or not.

  • isIncludedInROI        : This indicates whether this campaign ins included in ROI or not.

Sample request

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

Sample request for createACampaign
{
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "name":"new campaign",
   "startAt":1284079044,
   "endAt":1284079049,
   "budgetedCost":1.0,
   "actualCost":1.1,
   "isMemberAllowedReEntry":true,
   "fieldValues":[{"id": "5","value": "new value 234"}],
   "isReadOnly":false,
   "isSyncedWithCRM":true,
   "isIncludedInROI":true
}

Update A Campaign

The updateACampaign operation updates a campaign.

updateACampaign
<eloquaStandardAPI.updateACampaign>
    <campaignId>1</campaignId>
    <startAt>1284079044</startAt>
    <endAt>1284079049</endAt>
    <budgetedCost>1.0</budgetedCost>
    <actualCost>1.1</actualCost>
    <budgetedCostactualCostname>new campaign</name>
    <isMemberAllowedReEntry>true</isMemberAllowedReEntry>
    <fieldValues>[{"id": "5","value": "new value 234"}]</fieldValues>
    <elements></elements>
    <isReadOnly>false</isReadOnly>
    <campaignType></campaignType>
    <isReadOnlycampaignTypeproduct></product>
    <region></region>
    <isReadOnlycampaignTypeproductregioncrmId></crmId>
    <isSyncedWithCRM>true</isSyncedWithCRM>
    <isIncludedInROI>true</isIncludedInROI>
</eloquaStandardAPI.updateACampaign>
properties
  • campaignId             : Unique identifier of the campaign.

  • startAt                : Date time value of the campaign start.

  • endAt                  : Date time value of the campaign end.

  • budgetedCost           : Budgeted cost for the campaign.

  • actualCost             : Actual cost of the campaign.

  • name                   : Name of the campaign to create a campaign on this name.

  • isMemberAllowedReEntry : Boolean value, to set change permission to current user for this campaign.

  • fieldValues            : The array of the custom fields.

  • elements               : The email and segment elements for this campaign.

  • isReadOnly             : Boolean value, to set write permission to current user for this campaign.

  • campaignType            : The type of the campaign.

  • product                : The product of the campaign.

  • region                  : The region of the campaign.

  • crmId                   : The identifier of CRM.

  • isSyncedWithCRM        : This indicates whether this campaign ins synced with CRM or not.

  • isIncludedInROI        : This indicates whether this campaign ins included in ROI or not.

Sample request

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

Sample request for updateACampaign
{   
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "campaignId":"1",
   "name":"new campaign",
   "startAt":1284079044,
   "endAt":1284079049,
   "budgetedCost":1.0,
   "actualCost":1.1,
   "isMemberAllowedReEntry":true,
   "fieldValues":[{"id": "5","value": "new value 234"}],
   "isReadOnly":false,
   "isSyncedWithCRM":true,
   "isIncludedInROI":true
}

Get All Campaigns

The getAllCampaigns operation retrieves all campaigns.

getAllCampaigns
<eloquaStandardAPI.getAllCampaigns>
    <count>2</count>
    <depth>1</depth>
    <search></search>
    <page>1</page>
    <orderBy></orderBy>
    <lastUpdatedAt>1426066807</lastUpdatedAt>
    <extensions></extensions>
</eloquaStandardAPI.getAllCampaigns>
properties
  • count         : The number of results in a page to display. This must me in between 1 and 1000.

  • depth         : The RequestDepth. It can be 'Complete' or 'Reference' or 'Minimal' or 'Partial'.

  • search        : The search field, to search for that field.

  • page          : The page number to display. This must be greater than 1.

  • orderBy       : The order by property to order the fields.

  • lastUpdatedAt : The date time of the last update.

  • extensions    : The extensions to filter. Must follow the pattern : ^[A-Za-z0-9]+$.

Sample Request

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

Sample request for getAllCampaigns
{   
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "count":2,
   "page":1,
   "lastUpdatedAt":1426066807,
   "depth":"Complete"
}

Get A Campaign

The getACampaign operation retrieves the details of a campaign associated with the specified campaign id.

getACampaign
<eloquaStandardAPI.getACampaign>
	<campaignId>1</campaignId>
	<depth>Complete</depth>
</eloquaStandardAPI.getACampaign>
properties
  • campaignId : Unique identifier of the campaign.

  • depth      : The RequestDepth. It can be 'Complete' or 'Reference' or 'Minimal' or 'Partial'.

Sample request

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

Sample request for getACampaign
{   
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "campaignId":"1",
   "depth":"Complete"
}

Delete A Campaign

The deleteACampaign operation deletes the campaign associated with the specified campaign id.

deleteACampaign
<eloquaStandardAPI.deleteACampaign>
	<campaignId>1</campaignId>
</eloquaStandardAPI.deleteACampaign>
properties
  • campaignId : Unique identifier of the campaign.

Sample request

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

Sample request for deleteACampaign
{  
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "campaignId":"1"
}

Get Recent Campaigns

The getRecentCampaigns operation updates an account.

getRecentCampaigns
<eloquaStandardAPI.getRecentCampaigns>
    <count>2</count>
    <depth>Complete</depth>
    <extensions></extensions>
</eloquaStandardAPI.getRecentCampaigns>
properties
  • count      : The number of results in a page to display. This must me in between 1 and 1000.

  • depth      : The RequestDepth. It can be 'Complete' or 'Reference' or 'Minimal' or 'Partial'.

  • extensions : The extensions to filter. Must follow the pattern : ^[A-Za-z0-9]+$.

Sample request

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

Sample request for getRecentCampaigns
{   
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "campaignId":"1",
   "count":2,
   "page":1,
   "lastUpdatedAt":1426066807
}

Sample Configuration

Following is a sample proxy service that illustrates how to connect to Eloqua Standard API with the init operation to use the getAllCampaigns operation. The sample request for this proxy can be found in getAllCampaigns 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="eloqua_getAllCampaigns"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
    <target>
        <inSequence>
            <property name="siteName" expression="json-eval($.siteName)"/>
            <property name="username" expression="json-eval($.username)"/>
            <property name="password" expression="json-eval($.password)"/>
            <property name="count" expression="json-eval($.count)"/>
            <property name="depth" expression="json-eval($.depth)"/>
            <property name="search" expression="json-eval($.search)"/>
            <property name="page" expression="json-eval($.page)"/>
            <property name="orderBy" expression="json-eval($.orderBy)"/>
            <property name="lastUpdatedAt" expression="json-eval($.lastUpdatedAt)"/>
            <property name="extensions" expression="json-eval($.extensions)"/>
            <eloquaStandardAPI.init>
                <siteName>{$ctx:siteName}</siteName>
                <username>{$ctx:username}</username>
                <password>{$ctx:password}</password>
            </eloquaStandardAPI.init>
            <eloquaStandardAPI.getAllCampaigns>
                <count>{$ctx:count}</count>
                <depth>{$ctx:depth}</depth>
                <search>{$ctx:search}</search>
                <page>{$ctx:page}</page>
                <orderBy>{$ctx:orderBy}</orderBy>
                <lastUpdatedAt>{$ctx:lastUpdatedAt}</lastUpdatedAt>
                <extensions>{$ctx:extensions}</extensions>
            </eloquaStandardAPI.getAllCampaigns>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </target>
    <description/>
</proxy>