In this post, we'll show you how to activate a Campaign using the REST API. This is the 3rd step in the series Sending Email to a Segment or List of Contacts.
In the last step, we created the following Campaign :
Assuming the ID of the new Campaign is 1, we'll create a function that will be responsible for activating the Campaign :
public Campaign ActivateCampaign (int campaignId) { RestRequest request = new RestRequest(Method.POST) { Resource = "/assets/campaign/activate/" + campaignId, RequestFormat = DataFormat.Json }; IRestResponse<Campaign> response = _client.Execute<Campaign>(request); return response.Data; }
Note that a complete sample of the code is available here on Github.
The code call this function :
int campaignId=1; Campaign campaign = _campaignHelper.ActivateCampaign(campaignId);
That's all there is to it. After the call completes, your Campaign will be active.
See picture below :
Please note that the code samples referenced here are my own work and something that I've put together to try and help. I'll do my best to support it, but please understand that this code is not supported by Eloqua.
Thanks,
Fred