Campaign
The campaign record exposes a campaign to REST web services.
This record:
-
is not a subrecord
-
contains the following subrecords:
-
campaignEmail
-
campaignDrip
-
campaignDirectMail
-
campaignEvent
-
defaultEvent (read-only)
-
For more information about working with campaigns in the UI, see Campaign Overview.
The REST API Browser includes information about the field names and field types of the campaign record. It also includes the HTTP methods, request parameters, and operations available to this record. For details, see the REST API Browser’s campaign reference page.
For information about using the REST API Browser, see The REST API Browser.
Record ID
The record ID for a campaign REST record is campaign.
Prerequisites
You must enable the Marketing Automation feature before you can use this record through REST web services. For more information, see Marketing Automation Overview.
Limitations
Consider the following limitations when using the campaign record in REST.
-
The following field is not accessible through REST web services: Template Category.
-
The following supporting records are not exposed to REST:
-
Category
-
Audience
-
Vertical
-
Family
-
Search Engine
-
Channel
-
Offer
You can set related fields on the campaign record, but the supporting records cannot be accessed directly or modified.
-
Code Samples
The following samples show common actions for a campaign.
Get Campaign
GET <domain>/record/v1/campaign/<ID>
Update the Title Field on an Existing Campaign
PATCH <domain>/record/v1/campaign/127
{
"title": "New Campaign Title"
}
Add an Unscheduled Email Event to an Existing Campaign
PATCH <domain>/record/v1/campaign/<ID>
{ "campaignEmail": { "items": [{ "campaignGroup": "<Group ID>", "channel": "<Channel ID>", "cost": 11.0, "datescheduled": "2023-10-30", "timescheduled": "10:20", "description": "From REST", "promoCode": "<Protocode ID>", "status": "<Status ID>", "subscription": "<Subscription ID>", "template": "<Template ID>"
}] }
}