We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

Issue using Utility.UpdateEmailCampaign

StacyC
Regular Participant

Issue using Utility.UpdateEmailCampaign

I created a campaign with no problems but when I try and update an existing campaign then I get a 409 error until I change the name.  The problem is that it doesn't update the existing campaign it just creates a new campaign.

Can someone please look at the issue for me?

 

Thanks in advance

 

On a another note I noticed I can delete a campaign but since it goes in the trash it is not truly deleted so when I try

to create another one with the same name I run into an error saying that the campaign already exists.  Is there a way to completely delete the campaign?

 

 

 

4 REPLIES 4
JordanC84
Regular Participant

Hey Stacy,

 

I'm not expert but it might be because you are doing a POST to update your campaign rather than a PUT.

 

POST will try to create a campaign, and will give you an error if duplication occurs.  PUT will update it.

 

Check this out it might help (If you haven't already)

http://community.constantcontact.com/t5/Documentation/Updating-a-Campaign/ba-p/25045

 

Here's what the error code means:

409ConflictThere is a problem with the action you are trying to perform. Commonly, you are trying to "Create" (POST) a resource which already exists such as a Contact List or Email Address that already exists. In general, if a resource already exists, an application can "Update" the resource with a "PUT" request for that resource.

 

 

As for deletion, I'm not too sure (I'm not a CTCT employee).

 

Thanks,

 

Jordan

StacyC
Regular Participant

I appreciate your information but I am using the C# APIs so I would assume that if it updates it is using PUT instead of POST.  I will have to look into their source code to verify.  Hopefully someone who knows the C# APIs can answer that question for me.

Hi Stacy,

 

I'm fairly sure it isn't an issue with the wrapper, as I can successfully update an email campaign without changing its name.  Are you making a call to the GetEmailCampaign method and supplying the campaign ID?  Below is an example of how I update email campaigns with the .NET wrapper, in VB.

 

        Dim emailCampaign = Utility.GetEmailCampaignById(authData, "1112332746139")
        emailCampaign.EmailContentFormat = "HTML"
        emailCampaign.Content = "<html><title></title><body>test_02052013</body></html>"
        emailCampaign.TextContent = "<html><title></title><body>test</body></html>"
        emailCampaign.ContactLists = New System.Collections.Generic.List(Of ConstantContactBO.ContactList)
        emailCampaign.ContactLists.Add(New ConstantContactBO.ContactList("1"))
        ConstantContactUtility.Utility.UpdateEmailCampaign(authData, emailCampaign)

 

With regard to deleting a campaign, sorry, but there is no way to completely delete a campaign record.  It would have to be renamed, then moved to the trash to use the same name.

 

Best Regards,

Shannon W.

API Support Specialist

StacyC
Regular Participant

Apparently the issue is that if you do too much updating then it causes issues.

I was updating Organization, Greeting, ForwardLink, SubscribeLink along with the name of the Campaign.

Now that I am only updating certain things it seems to work now.

 

Thanks

Developer Portal

View API documentation, code samples, get your API key.

Visit Page