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.

Bulk activities

Highlighted
Frequent Visitor

Bulk activities

I get this error when I try to do post request

 

[{"error_key":"json.payload.type.unexpected","error_message":"We expected a json array but we received an a json object for one of the fields in the payload."}]

Tags (1)
2 REPLIES 2
Highlighted
Frequent Visitor

Re: Bulk activities

This is the dummy json supplied

 

{
"import_data": [{
"email_addresses": ["abc@gmail.com"],
"first_name": "abc",
"last_name": "pqr",
"addresses": [{
"line1": "1234",
"line2": "4567",
"city": "BALTIMORE",
"address_type": "Business",
"state_code": "mystate",
"postal_code": "21202"
}],
"home_phone": "123-345-5432",
"work_phone": "123-234-6789"
}, {
"email_addresses": ["pqr@yahoo.com"],
"first_name": "pqr",
"last_name": "xyz",
"addresses": [{
"line1": "5555555",
"line2": "",
"city": "LANCASTER",
"address_type": "Business",
"state_code": "mystate",
"postal_code": "29720"
}],
"home_phone": "",
"work_phone": "111-222-3333"
}],
"lists": ["5646347637"],
"column_names": ["EMAIL", "FIRST NAME", "LAST NAME", "ADDRESS LINE 1", "ADDRESS LINE 2", "CITY", "STATE", "Zip/Postal Code", "Home PHONE", "Work Phone"]
}

Highlighted
Moderator

Re: Bulk activities

Hello,

 

Thank you for reaching out to Constant Contact API Developer Support.

 

The issue is that you are including an "address_type" field in your "addresses" object which is not expected. This is not able to be used because there is no column header available for it. If you remove the address_type from your JSON, the call will complete successfully.

 

Please let us know if you have any other questions!

 

Regards,

David B.
Tier II 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