The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

CTCT exception while adding a schedule

SOLVED
Go to solution
Highlighted
Occasional Contributor

CTCT exception while adding a schedule

Hello, 

 

Am trying to build a C # application with the capability of creating and updating schedules for campaigns.

 

When am trying to create a new schedule, am first retrieving the campaign using the Getcampaign method and then using the AddCampaign method to add it to the account :

 

 

campaign = constantContact.GetCampaign(selCamp.CampaignId.ToString());
savedCampaign = constantContact.AddCampaign(campaign);

 

When I try and do that, I get a CTCT exception stating :

 

json.field.invalid:#/tracking_summary/activity_type: Property was found but is not permitted at this location. json.field.invalid:#/tracking_summary/campaign_id: Property was found but is not permitted at this location. json.field.invalid:#/tracking_summary/contact_id: Property was found but is not permitted at this location. json.field.invalid:#/tracking_summary/email_address: Property was found but is not permitted at this location.

 

From reading similar posts on this error, I understand that it has to do with some kiuind of inconsistency with the object am passing and the  JSON Schema validation. I was wondering if I could be further advised in dealing with this issue.

 

Thank You.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Honored Contributor

Re: CTCT exception while adding a schedule

Hello,

 

In this case, what is happening is that you are fetching an existing Campaign, and then re-submitting that data as a brand new campaign. While that same data can be used to update an existing campaign, you are required to make some changes in order to create a new campaign from that data. In this specific case you are having a problem because the tracking_summary data is present on the campaign you are trying to create. You could bypass that in your case by adding the following line of code before you add the campaign:

campaign.TrackingSummary = null;

If you are looking to get an idea of what values are valid when creating a campaign, you can review the API docuemntation here: http://developer.constantcontact.com/docs/email-campaigns/email-campaigns-collection.html?method=POS... (Any values listed as read-only should not be present when adding a campaign to Constant Contact)

 

Please let me know if you have any additional questions!

 

Best Regards,

Elijah G.
API Support Engineer

View solution in original post

2 REPLIES 2
Highlighted
Honored Contributor

Re: CTCT exception while adding a schedule

Hello,

 

In this case, what is happening is that you are fetching an existing Campaign, and then re-submitting that data as a brand new campaign. While that same data can be used to update an existing campaign, you are required to make some changes in order to create a new campaign from that data. In this specific case you are having a problem because the tracking_summary data is present on the campaign you are trying to create. You could bypass that in your case by adding the following line of code before you add the campaign:

campaign.TrackingSummary = null;

If you are looking to get an idea of what values are valid when creating a campaign, you can review the API docuemntation here: http://developer.constantcontact.com/docs/email-campaigns/email-campaigns-collection.html?method=POS... (Any values listed as read-only should not be present when adding a campaign to Constant Contact)

 

Please let me know if you have any additional questions!

 

Best Regards,

Elijah G.
API Support Engineer

View solution in original post

Highlighted
Occasional Contributor

Re: CTCT exception while adding a schedule

Hello Elijah ,

 

Thank you for that explanation & the API link.

 

It was very helful and I was successfully able to add and save a new schedule for a campaign.

 

Once again, thank you!

 

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured