cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

Updating events through API causes duplicate events to appear in Constant Contact UI

Highlighted
Occasional Advisor

Updating events through API causes duplicate events to appear in Constant Contact UI

We have two-way synchronization between CC events and our database, the event records for which have several fields that overlap - and sync - with their corresponding CC event.  The CC event and our event are linked by storing the CC event Id value in our event records.  We sync in both directions, creating CC events from our events and vice versa depending on within which application the event is initially created.

 

The event sync works fine overall, but we've observed that when updating a CC event based on changes to the event record in our database, the CC event appears duplicated in the My Campains list in the CC UI.   Only one of the duplicates has a view link that works and has its values updated correctly from the sync process.  Navigating to other duplicates causes the CC error page to appear. 

 

Also, the one event link that works shows the event status as DRAFT when the event is actually ACTIVE (as verified in both the Event record page in CC and the API tester).  Yet, there will be a duplicate of that event that has a status of ACTIVE but the link causes the CC error page to appear.

 

I've checked the events list that's pulled from the get-all-events API method and there are no duplicates appearing in that list. So what is causing the duplicates to appear in the My Campaigns list?

 

We are using the v2 API to sync and currently updating the following CC event fields for new and existing CC event records:

 

Name (only set for newly created events)
Title
StartDate (** Note that CC allows setting time on 5-minute increments but API requires 15-min increments)
EndDate
TimeZoneId
Location
Type
Contact.Name
Contact.OrganizationName
IsVirtualEvent
OnlineMeeting.Url (set if virtual event only)
Contact.PhoneNumber (set if virtual event only)

 

We recently changed the sync so that it didn't alter the Name property for an existing event, but that didn't seem to help.

 

 

 

7 REPLIES 7
CTCT Employee

Re: Updating events through API causes duplicate events to appear in Constant Contact UI

Hi there,

 

It seems like you're creating a new event object each time, which is resulting in the duplication. In order to be able to update events, and not just create them, you'd need to build in logic to decide whether the event you want to modify is a new or existing event. For a new event, handle it how you are now. For existing events, make a call to get the list of events in the account, and then make a call to get the event of interest using its event ID. Then, use THAT event object returned to you and update it.

 

The event ID retuned when you either create an event, or get the list of events in the account, is unique. You could store that event ID with your event database for later updates to it.

 

Best Regards,

Shannon Wallace

Partner API Support Engineer

Occasional Advisor

Re: Updating events through API causes duplicate events to appear in Constant Contact UI

Hi Shannon,

 

We are encountering this issue while using existing event objects retrieved as follows (referring to .NET SDK EventSpotService methods):

 

1. Call GetAllEventSpots to get collection of events, then filter collection by those with start dates meeting a cutoff date (X days ago).

2. Use the IDs from the filtered events collection to create a new collection of IndividualEvent (CC event) objects by calling GetEventSpot for each event ID.  We need the full event record so we can access the UpdateDate field for purposes of synchronization. [Feature request... add UpdateDate to GetAllEventSpots results as well as some query parameters to limit the results ;) ]

 

Then, for each event in that collection...

3. Check whether we have an event record in our database with a 'CCEventID' value matching the IndividualEvent.Id.

 

When no event record exists in our database...

4. Create a new event record in our database and record the IndividualEvent.Id value as 'CCEventID' in that record for future synchronizations.

5. Update the IndividualEvent (retrieved using GetEventSpot from step 2) using PutEventSpot so that we update its UpdateDate value to reflect the date/time of the current synchronization.  No changes are made to the IndividualEvent before calling PutEventSpot.  (We've also taken the path of waiting until a later sync to update the UpdateDate, but the end result is the same.)

 

No call to PostEventSpot is made during this process, yet it results in a second event of the same name displayed in our My Campaigns list in the CC UI.

 

In our most recent test to reproduce this issue, we created an event that had and Id value of: a07eareeuvn59f1d9db (observed on IndividualEvent object during debugging). 

The CC Id value recorded in the event record in our database was: a07eareeuvn59f1d9db

The CC Id value for that event shown in the API tester's GET method is: a07eareeuvn59f1d9db (call made after sync completed)

If a true duplicate CC event was created with a new Id value, we would see a companion duplicate event record in our database upon subsequent synchronizations, but no such duplicates are occurring.

 

So in summary we appear to be working with the event object pulled from CC, updating it, and sending it back without changing the ID, yet this process results in a duplicate of the event appearing (and only one of the duplicate links works; the other causes the error page to appear).

 

Please let me know if there is any other information I can provide.

 

Thanks,

 

Chuck

Occasional Advisor

Re: Updating events through API causes duplicate events to appear in Constant Contact UI

Checking in - can you provide any updates on the status of this issue?

 

Thanks

CTCT Employee

Re: Updating events through API causes duplicate events to appear in Constant Contact UI

Hi Chuck,

 

Sorry for the delay on this. I should have time to troubleshoot this issue today. We've been down a person in API support for a week, but are back at full strength as of today.

 

Best Regards,

Shannon Wallace

Partner API Support Engineer

CTCT Employee

Re: Updating events through API causes duplicate events to appear in Constant Contact UI

Hi Chuck,

 

I had some time to test this today, and couldn't reproduce the behavior. To clarify, when you say the event is duplicated in our UI, you mean you see two entries for the event when you go to the "EventSpot" tab in the account, right? You're taken to the "My Events" sub-tab by default. I can't seem to find "My Campaigns" anywhere in our UI, but that's not where I spend most of my time, of course.

 

To reproduce, I created a new event, added an invitation to it, did a GET to https://api.constantcontact.com/v2/eventspot/events?api_key=xxx, and then another GET to https://api.constantcontact.com/v2/eventspot/events/event-id?api_key=xxx. I then did a PUT to the latter URL that contains the particular event ID (to modify the existing event).

 

To be fair, I only changed the values below:

 

Title
StartDate 
EndDate
TimeZoneId
Location
Type
Contact.Name
Contact.OrganizationName

 

 

I omitted the following for simplicity. If you think there's any chance that modifying only these values below causes the issue, I can go back and test them, but that seems unlikely.

 

IsVirtualEvent
OnlineMeeting.Url (set if virtual event only)
Contact.PhoneNumber (set if virtual event only)

 

Can you identify times that this is happening and times it's not? Perhaps it's something particular to the account, or event settings. I can take a look at your code, and/or the specific account & event(s) that this is happening for. If you want me to look at more than account non-specific code, feel free to email webservices@constantcontact.com with the account username and an affected event.

 

Best Regards,

Shannon Wallace

Partner API Support Engineer

 

Occasional Advisor

Re: Updating events through API causes duplicate events to appear in Constant Contact UI

Hi Shannon,

 

Thanks for the update.  I see the duplicates on the home page (https://ui.constantcontact.com/rnavmap/distui/home) as well as the Campaigns page (https://ui.constantcontact.com/rnavmap/distui/campaigns).  This is in the new UI, not the old, so I don't have an EventSpots tab anymore.

 

When hovering over the links for the same duplicated event, the guid id parameter of the event link URL varies between links even though the event name is the same and even though there is only one event record based on the API tester.  I'll send account info per your suggestion so you can look at the actual data (all of it is test data) along with a screenshot.  See the event with name "Apr 11, 2015 Duplicate Test 2" as an example. 

 

The guid id parameter in the link URLs doesn't seem to be the EventSpot ID (which isn't a guid), so I'm guessing it ties to another record to which the EventSpot record is linked.  Does the UI now pair events with email campains or some other type of "container" record to package email campaigns with events?  If so, this pairing seems to be what is getting duplicated (i.e., one EventSpot record gets a new campaign[?] pair or parent when it is updated through the API, leaving previously linked campaign[?] records orphaned).

 

I don't think altering the values makes any difference in the behavior we've seen.  Simply retrieving a single event and then updating it without changing any values has generated these apparent duplicates.

 

Chuck

CTCT Employee

Re: Updating events through API causes duplicate events to appear in Constant Contact UI

Hi Chuck,

 

Thank you for the details, and I will respond to your email when I've tested more. It would make sense that this is happening with a different (newer) type of account than I was testing in. I think you're probably right about the campaign 'container' in the UI having an issue.

 

Best Regards,

Shannon Wallace

Partner API Support Engineer