API Create function and replacing campaigns

using the API create (create a draft campaign) function, if you try to upload the same email campaign twice you get the following error:
303: Duplicate Campaign Name

Is there a way to instead update the existing campaign, say if I make changes to the html and want to overwrite it using the API?

roshodgekiss roshodgekiss, 3 years ago

Hi there, JohnP! At present, there isn't a method for updating campaigns - you need to delete the existing campaign, then create a new one instead. It's a touch more work, but hopefully that solves the mystery here!

That said, we've had a few requests for such a method, so we'll keep you posted if it's something we add at a later date. Keep being a champion! :D


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
JohnP JohnP, 3 years ago

Thanks Ros! I'll just add something like:

if($result->http_status_code == 303) {
// delete and reupload
}

JohnP JohnP, 3 years ago

Brings me to my next question - I need the CampaignID to delete an existing campaign. How can I get this using only the campaign name?

I assume I'd have search all campaigns and cross-reference the name (which I know) to get it...

roshodgekiss roshodgekiss, 3 years ago

Hi there, your guess is right - you can get the Campaign Name and Campaign ID using the Drafts method for a given client. Hope this helps :)


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098