We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

Bulk activities

GrahamS24
Participant

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

2 REPLIES 2
GrahamS24
Participant

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

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