cancel
Showing results for 
Search instead for 
Did you mean: 

adding 2 contacts via POST, why doesn't it work?

Occasional Contributor

adding 2 contacts via POST, why doesn't it work?

I'm trying to add 2 contacts by doing a POST to contacts but you add just the first one

 

your reply contains detailed information for the first one and only basics for the second one but regardless of your reply, in real life, only 1 contact is added

 

you api docs confirm I can add up to 20 something contacts this way but it does NOT work

 

here's the source query:

 

 

 

 

<entry xmlns="http://www.w3.org/2005/Atom">
<id>data:,none</id>
<title type="text"></title>
<author></author>
<updated>2012-10-21T13:11:15Z</updated>
<summary type="text">Contact</summary>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<EmailAddress>c9@example.com</EmailAddress>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/someone/lists/8"></ContactList>
</ContactLists>
</Contact>
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<EmailAddress>c10@example.com</EmailAddress>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/someone/lists/8"></ContactList>
</ContactLists>
</Contact>
</content>
</entry>

4 REPLIES 4
Moderator

Re: adding 2 contacts via POST, why doesn't it work?

Looks like this is likely a problem with our documentation and the clarity of this endpoint.  We don't actually allow creation of more than one contact per request.  The fact that we actually create the first contact and ignore the second is probably a defect as well, we don't usually like to drop requests on the floor without appropriate error messaging back to developers.  Any chance you can point out the documentation that caused this confusion, I'll make sure we update it.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Contributor

Re: adding 2 contacts via POST, why doesn't it work?

here it says I can add up to 25 contacts in one request:

http://community.constantcontact.com/t5/Documentation/Creating-a-Contact/ba-p/25059

"The use of this API to create a contact is designed to handle a small number of contacts (i.e. less than 25)."

 

then in the forums, Shannon_W says: "For more than a few contact adds at a time, it would be best to use the bulk uploader (activities) method, not the individual add method."

which means you used to support this, here's the link:

http://community.constantcontact.com/t5/Developer-Support-ask-questions/API-Bulk-Add-Update-Contacts...

 

 

there's a limitation with your add contact activity that I do not like, all the contact in ONE request have to go to one or more hardcoded lists

what I would like to do is use ONE request, pick like 100 contacts, then say first 10 go to this/these list, next 35 go to this/these etc.

 

can you do that for me? ;)

Moderator

Re: adding 2 contacts via POST, why doesn't it work?

Thanks, definitely a lack of clarity into that statemen that's causing the problem.  That statement is really there to help lead developers to the right API for the right job.  Because we only support creating a single contact per POST request, you need to do serial HTTP requests, which can add up to quite a bit of round trip time.  We recommend only using this API for fewer than 25 consecutive requests for this reason.  It's primary intention is for interupt driven creation requests, such as from a signup form or when updating a single contact record in a CRM.  The Bulk Activity API is asynchronous and intended to be used for bulk updates or bulk adds. 

 

In the scenario you described, it may make more sense to think about the problem in reverse.  Instead of saying "these 10 contacts will be on lists a, b and c and these 12 will be on b and c", you could think of it as "22 contacts need to be on list b and" as a single Bulk Activity request and "10 contacts need to be on list a" as a second. 

 

Sorry again for the confusion, we'll look at changing the wording to make the intention of the docs more clear.

Dave Berard
Senior Product Manager, Constant Contact
Occasional Contributor

Re: adding 2 contacts via POST, why doesn't it work?

 

it seems I'll end up using several bulk requests...

 

thanks