Create a campaign
/api/rest/2.0/assets/campaign
Request
- application/json
object
Campaign
-
actualCost:
string
The campaign's actual cost.
-
adCampaignId:
string
Campaign_Field_AdCampaignId_Description
-
badgeId:
string
The badge id of the campaign.
-
budgetedCost:
string
The campaign's projected cost.
-
campaignCategory:
string
Defines whether a Campaign is simple or multi-step. The value
emailMarketing
should be used for simple campaigns, andcontact
for multi-step campaigns. -
campaignClassification:
string
Campaign_Field_CampaignClassification_Description
-
campaignType:
string
The campaign's type.
-
clrEndDate:
string
The end date of the clr.
-
createdAt:
string
Read Only:
true
The date and time the campaign was created, expressed in Unix time. -
createdBy:
string
Read Only:
true
The login id of the user who created the campaign. -
createdByName:
string
The name of the user who created the campaign.
-
crmId:
string
The id of the customer relationship management application. When sending update requests, if
crmId
is not included in the request and acrmId
value exists, it will be blanked. -
currentStatus:
string
The campaign's current status:
Active
,Draft
,Scheduled
, orCompleted
. -
depth:
string
Read Only:
true
Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth:minimal
,partial
, andcomplete
. For more information, see Request depth. -
description:
string
The description of the campaign.
-
elements:
array elements
A list of campaign elements.
-
endAt:
string
The date and time the campaign will end.
-
fieldValues:
array fieldValues
Array containing
type
andid
values for all of the contactFields associated with a given contact. For campaigns, "fieldValues" include all custom campaign fields (type, id, value). -
firstActivation:
string
Read Only:
true
The date and time the campaign was originally activated. -
folderId:
string
Read Only:
true
The folder id of the folder which contains the campaign. -
id:
string
Read Only:
true
Id of the campaign. -
isBypassHistoryDisabled:
string
Campaign_Field_IsBypassHistoryDisabled_Description
-
isEmailMarketingCampaign:
string
Whether or not the campaign is an email marketing campaign.
-
isExitHistoryDisabled:
string
Campaign_Field_IsExitHistoryDisabled_Description
-
isIncludedInROI:
string
Whether or not the campaign is included in return on investment.
-
isMemberAllowedReEntry:
string
Whether or not members are allowed to re-enter the campaign.
-
isReadOnly:
string
Whether or not the campaign is read only.
-
isSyncedWithCRM:
string
Whether or not the campaign is synced with a customer relationship management application.
-
isUpdatingCrmId:
string
Campaign_Field_IsUpdatingCrmId_Description
-
memberCount:
string
Read Only:
true
The amount of members that entered the campaign in the last 90 days. This property is only returned whendepth
is set topartial
orcomplete
. This is a read-only property. -
name:
string
The name of the campaign.
-
permissions:
array permissions
The permissions for the campaign granted to your current instance. This is a read-only property.
-
product:
string
The campaign's product value.
-
referenceProduct:
string
Campaign_Field_ReferenceProduct_Description
-
region:
string
The campaign's region value.
-
runAsUserId:
string
The login id of the user to activate the campaign.
-
scheduledFor:
string
Read Only:
true
The date the campaign is scheduled. -
sourceTemplateId:
string
Id of the template used to create the asset.
-
startAt:
string
The date time for which the campaign will activate, expressed in Unix time.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
updatedAt:
string
Read Only:
true
Unix timestamp for the date and time the campaign was last updated. This is a read-only property. -
updatedBy:
string
Read Only:
true
The login id of the user that last updated the campaign. -
updatedByName:
string
The name of the user who last updated the campaign.
array
-
Array of:
object CampaignElement
Title:
CampaignElement
array
type
and id
values for all of the contactFields associated with a given contact. For campaigns, "fieldValues" include all custom campaign fields (type, id, value).-
Array of:
object FieldValue
Title:
FieldValue
array
object
CampaignElement
-
createdAt:
string
Read Only:
true
The date and time the campaign element was created, expressed in Unix time. -
createdBy:
string
Read Only:
true
The login id of the user who created the campaign element. -
createdByName:
string
The name of the user who created the campaign element.
-
currentStatus:
string
The campaign element's current status.
-
depth:
string
Read Only:
true
Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth:minimal
,partial
, andcomplete
. Any other values passed are reset tocomplete
by default. For more information, see Request depth. -
description:
string
The description of the campaign element.
-
folderId:
string
Read Only:
true
Id of the associated folder. -
id:
string
Read Only:
true
Id of the campaign element. This is a read-only property. -
memberCount:
string
Amount of members within the campaign element. This is a read-only property.
-
memberErrorCount:
string
Amount of members within the campaign element in errored status. This is a read-only property.
-
name:
string
Name of the campaign element. This is a read-only property.
-
outputTerminals:
array outputTerminals
A list of the campaign element ids within the campaign. This is a read-only property.
-
permissions:
array permissions
The permissions for the campaign element granted to your current instance. This is a read-only property.
-
position:
object Position
Title:
Position
-
scheduledFor:
string
Read Only:
true
The date the campaign element is scheduled. -
sourceTemplateId:
string
The id of the source template.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
updatedAt:
string
Read Only:
true
Unix timestamp for the date and time the campaign element was last updated. -
updatedBy:
string
Read Only:
true
The login id of the user that last updated the campaign element. -
updatedByName:
string
The name of the user who last updated the campaign element.
array
-
Array of:
object CampaignOutputTerminal
Title:
CampaignOutputTerminal
array
object
Position
-
type:
string
The campaign element's type. This is a read-only property.
-
x:
string
The position of the campaign element on the x axis.
-
y:
string
The position of the campaign element on the y axis.
object
CampaignOutputTerminal
-
connectedId:
string
The connected id of the campaign output terminal. This is a read-only property.
-
connectedType:
string
The campaign output terminal's connection type. This is a read-only property.
-
createdAt:
string
Read Only:
true
The date and time the campaign output terminal was created, expressed in Unix time. -
createdBy:
string
Read Only:
true
The login id of the user who created the campaign output terminal. -
createdByName:
string
The name of the user who created the campaign output terminal.
-
currentStatus:
string
The campaign output terminal's current status.
-
depth:
string
Read Only:
true
Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth:minimal
,partial
, andcomplete
. For more information, see Request depth. -
description:
string
The description of the campaign output terminal.
-
folderId:
string
Read Only:
true
Id of the associated folder. -
id:
string
Read Only:
true
Id of the campaign output terminal. This is a read-only property. -
name:
string
Name of the campaign output terminal.
-
permissions:
array permissions
The permissions for the campaign output terminal granted to your current instance.
-
scheduledFor:
string
Read Only:
true
The date the campaign output terminal is scheduled. -
sourceTemplateId:
string
The id of the source template.
-
terminalType:
string
The campaign output terminal type. This is a read-only property.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
updatedAt:
string
Read Only:
true
Unix timestamp for the date and time the campaign output terminal was last updated. This is a read-only property. -
updatedBy:
string
Read Only:
true
The login id of the user that last updated the campaign output terminal. -
updatedByName:
string
The name of the user who last updated the campaign output terminal.
array
object
FieldValue
-
id:
string
Read Only:
true
The id of the field to be set to the corresponding value. -
name:
string
Name of the field value.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
value:
string
The value to set the corresponding field id to. Date values must be submitted as a unix timestamp.
Response
- application/json
201 Response
object
Campaign
-
actualCost:
string
The campaign's actual cost.
-
adCampaignId:
string
Campaign_Field_AdCampaignId_Description
-
badgeId:
string
The badge id of the campaign.
-
budgetedCost:
string
The campaign's projected cost.
-
campaignCategory:
string
Defines whether a Campaign is simple or multi-step. The value
emailMarketing
should be used for simple campaigns, andcontact
for multi-step campaigns. -
campaignClassification:
string
Campaign_Field_CampaignClassification_Description
-
campaignType:
string
The campaign's type.
-
clrEndDate:
string
The end date of the clr.
-
createdAt:
string
Read Only:
true
The date and time the campaign was created, expressed in Unix time. -
createdBy:
string
Read Only:
true
The login id of the user who created the campaign. -
createdByName:
string
The name of the user who created the campaign.
-
crmId:
string
The id of the customer relationship management application. When sending update requests, if
crmId
is not included in the request and acrmId
value exists, it will be blanked. -
currentStatus:
string
The campaign's current status:
Active
,Draft
,Scheduled
, orCompleted
. -
depth:
string
Read Only:
true
Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth:minimal
,partial
, andcomplete
. For more information, see Request depth. -
description:
string
The description of the campaign.
-
elements:
array elements
A list of campaign elements.
-
endAt:
string
The date and time the campaign will end.
-
fieldValues:
array fieldValues
Array containing
type
andid
values for all of the contactFields associated with a given contact. For campaigns, "fieldValues" include all custom campaign fields (type, id, value). -
firstActivation:
string
Read Only:
true
The date and time the campaign was originally activated. -
folderId:
string
Read Only:
true
The folder id of the folder which contains the campaign. -
id:
string
Read Only:
true
Id of the campaign. -
isBypassHistoryDisabled:
string
Campaign_Field_IsBypassHistoryDisabled_Description
-
isEmailMarketingCampaign:
string
Whether or not the campaign is an email marketing campaign.
-
isExitHistoryDisabled:
string
Campaign_Field_IsExitHistoryDisabled_Description
-
isIncludedInROI:
string
Whether or not the campaign is included in return on investment.
-
isMemberAllowedReEntry:
string
Whether or not members are allowed to re-enter the campaign.
-
isReadOnly:
string
Whether or not the campaign is read only.
-
isSyncedWithCRM:
string
Whether or not the campaign is synced with a customer relationship management application.
-
isUpdatingCrmId:
string
Campaign_Field_IsUpdatingCrmId_Description
-
memberCount:
string
Read Only:
true
The amount of members that entered the campaign in the last 90 days. This property is only returned whendepth
is set topartial
orcomplete
. This is a read-only property. -
name:
string
The name of the campaign.
-
permissions:
array permissions
The permissions for the campaign granted to your current instance. This is a read-only property.
-
product:
string
The campaign's product value.
-
referenceProduct:
string
Campaign_Field_ReferenceProduct_Description
-
region:
string
The campaign's region value.
-
runAsUserId:
string
The login id of the user to activate the campaign.
-
scheduledFor:
string
Read Only:
true
The date the campaign is scheduled. -
sourceTemplateId:
string
Id of the template used to create the asset.
-
startAt:
string
The date time for which the campaign will activate, expressed in Unix time.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
updatedAt:
string
Read Only:
true
Unix timestamp for the date and time the campaign was last updated. This is a read-only property. -
updatedBy:
string
Read Only:
true
The login id of the user that last updated the campaign. -
updatedByName:
string
The name of the user who last updated the campaign.
array
-
Array of:
object CampaignElement
Title:
CampaignElement
array
type
and id
values for all of the contactFields associated with a given contact. For campaigns, "fieldValues" include all custom campaign fields (type, id, value).-
Array of:
object FieldValue
Title:
FieldValue
array
object
CampaignElement
-
createdAt:
string
Read Only:
true
The date and time the campaign element was created, expressed in Unix time. -
createdBy:
string
Read Only:
true
The login id of the user who created the campaign element. -
createdByName:
string
The name of the user who created the campaign element.
-
currentStatus:
string
The campaign element's current status.
-
depth:
string
Read Only:
true
Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth:minimal
,partial
, andcomplete
. Any other values passed are reset tocomplete
by default. For more information, see Request depth. -
description:
string
The description of the campaign element.
-
folderId:
string
Read Only:
true
Id of the associated folder. -
id:
string
Read Only:
true
Id of the campaign element. This is a read-only property. -
memberCount:
string
Amount of members within the campaign element. This is a read-only property.
-
memberErrorCount:
string
Amount of members within the campaign element in errored status. This is a read-only property.
-
name:
string
Name of the campaign element. This is a read-only property.
-
outputTerminals:
array outputTerminals
A list of the campaign element ids within the campaign. This is a read-only property.
-
permissions:
array permissions
The permissions for the campaign element granted to your current instance. This is a read-only property.
-
position:
object Position
Title:
Position
-
scheduledFor:
string
Read Only:
true
The date the campaign element is scheduled. -
sourceTemplateId:
string
The id of the source template.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
updatedAt:
string
Read Only:
true
Unix timestamp for the date and time the campaign element was last updated. -
updatedBy:
string
Read Only:
true
The login id of the user that last updated the campaign element. -
updatedByName:
string
The name of the user who last updated the campaign element.
array
-
Array of:
object CampaignOutputTerminal
Title:
CampaignOutputTerminal
array
object
Position
-
type:
string
The campaign element's type. This is a read-only property.
-
x:
string
The position of the campaign element on the x axis.
-
y:
string
The position of the campaign element on the y axis.
object
CampaignOutputTerminal
-
connectedId:
string
The connected id of the campaign output terminal. This is a read-only property.
-
connectedType:
string
The campaign output terminal's connection type. This is a read-only property.
-
createdAt:
string
Read Only:
true
The date and time the campaign output terminal was created, expressed in Unix time. -
createdBy:
string
Read Only:
true
The login id of the user who created the campaign output terminal. -
createdByName:
string
The name of the user who created the campaign output terminal.
-
currentStatus:
string
The campaign output terminal's current status.
-
depth:
string
Read Only:
true
Level of detail returned by the request. Eloqua APIs can retrieve entities at three different levels of depth:minimal
,partial
, andcomplete
. For more information, see Request depth. -
description:
string
The description of the campaign output terminal.
-
folderId:
string
Read Only:
true
Id of the associated folder. -
id:
string
Read Only:
true
Id of the campaign output terminal. This is a read-only property. -
name:
string
Name of the campaign output terminal.
-
permissions:
array permissions
The permissions for the campaign output terminal granted to your current instance.
-
scheduledFor:
string
Read Only:
true
The date the campaign output terminal is scheduled. -
sourceTemplateId:
string
The id of the source template.
-
terminalType:
string
The campaign output terminal type. This is a read-only property.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
updatedAt:
string
Read Only:
true
Unix timestamp for the date and time the campaign output terminal was last updated. This is a read-only property. -
updatedBy:
string
Read Only:
true
The login id of the user that last updated the campaign output terminal. -
updatedByName:
string
The name of the user who last updated the campaign output terminal.
array
object
FieldValue
-
id:
string
Read Only:
true
The id of the field to be set to the corresponding value. -
name:
string
Name of the field value.
-
type:
string
The asset's type in Eloqua. This is a read-only property.
-
value:
string
The value to set the corresponding field id to. Date values must be submitted as a unix timestamp.
400 Response
401 Response
403 Response
404 Response
500 Response
Examples
The following examples demonstrate how to create a new campaign using an HTTP request and cURL. For more information on requests, see API requests.
HTTP Request Example
Create a new campaign:
POST /api/REST/2.0/assets/campaign
Content-Type: application/json
Request body:
{
"name": "My New Campaign",
"budgetedCost": "1000.00"
}
Response:
{
"type": "Campaign",
"currentStatus": "Draft",
"id": "49",
"createdAt": "1468609818",
"createdBy": "9",
"depth": "complete",
"folderId": "1263",
"name": "My New Campaign",
"permissions": [
"Retrieve",
"SetSecurity",
"Delete",
"Update",
"Activate"
],
"updatedAt": "1468609818",
"updatedBy": "9",
"isReadOnly": "false",
"actualCost": "0",
"budgetedCost": "1000.00",
"campaignCategory": "contact",
"campaignType": "",
"fieldValues": [
{
"type": "FieldValue",
"id": "5",
"value": ""
},
{
"type": "FieldValue",
"id": "6",
"value": ""
},
{
"type": "FieldValue",
"id": "7",
"value": ""
},
{
"type": "FieldValue",
"id": "8",
"value": ""
}
],
"isEmailMarketingCampaign": "false",
"isIncludedInROI": "false",
"isMemberAllowedReEntry": "false",
"isSyncedWithCRM": "false",
"product": "",
"region": ""
}
cURL Example
Here is the same example in cURL given an instance with the name APITest
, username API.User
, and POD of 3
.
curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data '{"name":"My New Campaign","budgetedCost":"1000.00"}' https://secure.p03.eloqua.com/api/rest/2.0/assets/campaign
HTTP Request Example
Create a new campaign with a custom end date:
POST /assets/campaign
Content-Type: application/json
Request body:
{
"name": "Campaign with Custom End Date",
"startAt": "1518739200",
"endAt": "1530210149",
"x_e10_activationEndType": "custom"
}
Response:
{
"type": "Campaign",
"x_e10_activationEndType": "custom",
"x_e10_createdAt": "1521218146",
"x_e10_createdBy": "9",
"currentStatus": "Draft",
"id": "108",
"createdAt": "1521218142",
"createdBy": "9",
"depth": "complete",
"folderId": "1263",
"name": "Campaign with Custom End Date",
"permissions": [
"Retrieve",
"SetSecurity",
"Delete",
"Update",
"Activate"
],
"updatedAt": "1521218142",
"updatedBy": "9",
"isReadOnly": "false",
"actualCost": "0",
"budgetedCost": "0",
"campaignCategory": "contact",
"campaignType": "",
"endAt": "1530210149",
"fieldValues": [],
"isEmailMarketingCampaign": "false",
"isIncludedInROI": "false",
"isMemberAllowedReEntry": "false",
"isSyncedWithCRM": "false",
"product": "",
"region": "",
"startAt": "1518739200"
}
cURL Example
Here is the same example in cURL given an instance with the name APITest
, username API.User
, and POD of 3
.
curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data '{"name":"Campaign with Custom End Date","startAt":"1518739200","endAt":"1530210149","x_e10_activationEndType":"custom"}' https://secure.p03.eloqua.com/api/rest/2.0/assets/campaign
HTTP Request Example
Create a new simple email campaign:
POST /assets/campaign
Content-Type: application/json
Request body:
{
"name": "Simple_Email_Campaign",
"campaignCategory": "emailMarketing",
"elements": [
{
"type": "CampaignSegment",
"id": "-1",
"name": "Segment members",
"segmentId": "88",
"outputTerminals": [
{
"type": "CampaignOutputTerminal",
"connectedId": "-2",
"connectedType": "CampaignEmail",
"terminalType": "out"
}
],
"isFinished": "false",
"isRecurring": "false"
},
{
"type": "CampaignEmail",
"id": "-2",
"sendTimePeriod": "sendAllEmailAtOnce",
"emailId": "10",
"includeListUnsubscribeHeader": "true",
"isAllowingResend": "false",
"isAllowingSentToMasterExclude": "false",
"isAllowingSentToUnsubscribe": "false",
"stoArbitrationDelay": "1",
"stoType": "none",
"position": {
"x": "393",
"y": "224"
}
}
]
}
Note:
Your segment id and email id will differ from the ids used in this example request body. Use the Segments and Emails API endpoints to verify the asset ids from your Eloqua instance.Response:
{
"type": "Campaign",
"currentStatus": "Draft",
"id": "127",
"createdAt": "1571666618",
"createdBy": "9",
"depth": "complete",
"folderId": "1263",
"name": "Simple_Email_Campaign",
"permissions": [
"Retrieve",
"SetSecurity",
"Delete",
"Update",
"Activate"
],
"updatedAt": "1571666618",
"updatedBy": "9",
"elements": [
{
"type": "CampaignSegment",
"id": "2264",
"initialId": "-1",
"name": "Segment members",
"memberCount": "0",
"memberErrorCount": "0",
"outputTerminals": [
{
"type": "CampaignOutputTerminal",
"id": "1847",
"connectedId": "2265",
"connectedType": "CampaignEmail",
"terminalType": "out"
}
],
"position": {
"type": "Position",
"x": "0",
"y": "0"
},
"isFinished": "false",
"isRecurring": "false",
"segmentId": "88"
},
{
"type": "CampaignEmail",
"id": "2265",
"initialId": "-2",
"memberCount": "0",
"memberErrorCount": "0",
"position": {
"type": "Position",
"x": "393",
"y": "224"
},
"sendTimePeriod": "sendAllEmailAtOnce",
"emailId": "10",
"includeListUnsubscribeHeader": "true",
"isAllowingResend": "false",
"isAllowingSentToMasterExclude": "false",
"isAllowingSentToUnsubscribe": "false",
"stoArbitrationDelay": "1",
"stoType": "none"
}
],
"isReadOnly": "false",
"actualCost": "0",
"budgetedCost": "0",
"campaignCategory": "emailMarketing",
"campaignType": "",
"crmId": "",
"fieldValues": [
{
"type": "FieldValue",
"id": "9",
"value": ""
},
{
"type": "FieldValue",
"id": "10",
"value": ""
},
{
"type": "FieldValue",
"id": "11",
"value": ""
}
],
"isEmailMarketingCampaign": "true",
"isIncludedInROI": "false",
"isMemberAllowedReEntry": "false",
"isSyncedWithCRM": "false",
"product": "",
"region": ""
}
cURL Example
Here is the same example in cURL given an instance with the name APITest
, username API.User
, and POD of 3
.
curl --user "APITest\API.User" --header "Content-Type: application/json" --request POST --data '{"name":"Simple_Email_Campaign","campaignCategory":"emailMarketing","elements":[{"type":"CampaignSegment","id":"-1","name":"Segment members","segmentId":"88","outputTerminals":[{"type":"CampaignOutputTerminal","connectedId":"-2","connectedType":"CampaignEmail","terminalType":"out"}],"isFinished":"false","isRecurring":"false"},{"type":"CampaignEmail","id":"-2","sendTimePeriod":"sendAllEmailAtOnce","emailId":"10","includeListUnsubscribeHeader":"true","isAllowingResend":"false","isAllowingSentToMasterExclude":"false","isAllowingSentToUnsubscribe":"false","stoArbitrationDelay":"1","stoType":"none","position":{"x":"393","y":"224"}}]}' https://secure.p03.eloqua.com/api/rest/2.0/assets/campaign