Bulk Activity API - request Json string

Regular Participant

Bulk Activity API - request Json string

Can someone confirm that the JSON string shown as the "Example JSON Request Body" on (http://developer.constantcontact.com/docs/bulk_activities_api/bulk-activities-add-contacts.html) is indeed correct.  The example shows multiple contacts within the same array when I believe they should be in separate arrays.  What's displayed is valid JSON but doesn't make sense to ensure the data is well organized.

 

Am I wrong?

 

Thanks

 

 

2 REPLIES 2
Participant

I agree. It looks like the sample JSON body should be this:

 

{
    "import_data": [{
    "email_addresses": [
    "user1@example.com"
    ],
    "first_name": "John",
    "middle_name": "R",
    "last_name": "Smith",
    "job_title": "",
    "company_name": "My Company",
    "home_phone": "5555551212",
    "addresses": [{
    "line1": "123 Partridge Lane",
    "line2": "Apt. 3",
    "line3": "",
    "city": "Anytown",
    "address_type": "PERSONAL",
    "state_code": "NH",
    "country_code": "US",
    "postal_code": "02145"
    }],
     },{
    "email_addresses": [
    "user2@example.com"
    ],
    "first_name": "Jane",
    "middle_name": "A",
    "last_name": "Doe",
    "job_title": "",
    "company_name": "Acme, Inc.",
    "home_phone": "5555551213",
    "addresses": [{
    "line1": "456 Jones Road",
    "line2": "",
    "line3": "",
    "city": "AnyTownShip",
    "address_type": "PERSONAL",
    "state_code": "DE",
    "country_code": "US",
    "postal_code": "01234"
    }],
    "custom_fields": [{
    "name": "Custom Field 6",
    "value": "Blue Jeans"
    }, {
    "name": "Custom Field 12",
    "value": "Special Order"
    }]
    }, {
    "email_addresses": [
    "user3@example.com"
    ],
    "first_name": "Pradeep",
    "middle_name": "J",
    "last_name": "Patel",
    "job_title": "",
    "company_name": "Acme Movers",
    "home_phone": "5555551214"
    }],
    "lists": [
    "4",
    "5",
    "6"
    ],
    "column_names": [
    "EMAIL",
    "FIRST NAME",
    "MIDDLE NAME",
    "LAST NAME",
    "JOB TITLE",
    "COMPANY NAME",
    "HOME PHONE",
    "Custom Field 6"
    ]
}

 

There appears to be a missing },{ before the second "email_addresses". Adding that splits the import_data array into objects that actually make sense.

 

Thanks for pointing this out.  Having our documentation team take a look at this now and hopefully will have this updated this morning with a corrected sample JSON payload. 

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page