create campaign

LyndaS12746
Participant

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
Elijah_G
Member

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