Bulk activities

CityWorthYourHome
Rookie
0 Votes

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."}]

2 REPLIES 2
CityWorthYourHome
Rookie
0 Votes

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"]
}

David_B.
Employee
0 Votes

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

Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up