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.

Get an error when add campaign by api

Highlighted
Regular Visitor

Get an error when add campaign by api

Hello

 

I want to create a new campaign by API and API return an error.Please solve issue.

 

My json for Create campaigns is :

 

{"reply_to_email":"abc@gmail.com","from_name":"test","name":"new test","subject":"Test with newsletter","email_content":"This is my HTML content","text_content":"hello text"}

The error message show after run API and the error is below :

 

Array
(
    [0] => stdClass Object
        (
            [error_key] => http.status.bad_request
            [error_message] => Please enter a valid email address.
        )

)

 Please suggest what can i do for this issue.

1 REPLY 1
Highlighted
Moderator

Re: Get an error when add campaign by api

Hello,

Is that the actual data you are trying to use?

If so, it appears that you are missing some fields and are not formatting your email content correctly so you are likely to see further errors after resolving this one. Please see our documentation for creating an email campaign for a complete list of fields and the format for each: https://developer.constantcontact.com/docs/email-campaigns/email-campaigns-collection.html?method=PO...

For this issue specifically, you need to ensure that the from and reply to email addresses are set to be a verified email address associated with the account. If you don't have abc@gmail.com verified on the Constant Contact account, you will see this error if you try to set this as the from or reply to address for an email campaign.

Please let me know if you have any other questions!

Sincerely,
David B.
API Support Specialist

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