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.

create campaign

Highlighted
Member

create campaign

When testing using the API to create campaigns (using .net wrapper) I'm running into a problem with validation.

 

given this json request:

{
"email_content":"<html><body><h1>this is the email content<\/h1><\/body><\/html>",
"from_email":"office@ihdschool.com",
"from_name":"IHDS School",
"message_footer":{
"address_line_1":"7040 Avenida Encinas",
"address_line_2":"#104-380",
"city":"Carlsbad",
"country":"US",
"forward_email_link_text":"Forward this email",
"include_forward_email":true,
"include_subscribe_link":true,
"organization_name":"International Human Design School",
"postal_code":"92011",
"state":"CA",
"subscribe_link_text":"Subscribe to Our Newsletter!"
},
"name":"test1",
"subject":"my test campaign",
"text_content":"this is the content"
}

 yeilds the following error 

http.status.bad_request:Please enter a valid email address.

 The only email address present is the 'from_email' property and it is a verified address being used for all other campaigns (that we currently create through the UI)

 

any idea on why this is failing?

 

Thanks

1 REPLY 1
Highlighted
Honored Contributor

Re: create campaign

Hello,

 

In this case the issue is that your request JSON and campaign object has no value set for the reply_to_email field. With the .NET wrapper you can correct this with the following code:

campaignObject.ReplyToEmail = "email@example.com";

 As long as the reply-to email is set before you attempt to create the campaign, the API call should be successful. This is happening because the reply-to email field is a required field.

 

If you're still having any difficulty after adding this info to the campaign, please let me know!

 

Sincerely,

Elijah G.
API Support Engineer
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