Skip Menu |

This queue is for tickets about the Email-ConstantContact CPAN distribution.

Report information
The Basics
Id: 56465
Status: resolved
Priority: 0/
Queue: Email-ConstantContact

People
Owner: Nobody in particular
Requestors: brad.simmons [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: adding a new contact
Date: Sat, 10 Apr 2010 08:38:10 -0500
To: bug-email-constantcontact [...] rt.cpan.org
From: brad simmons <brad.simmons [...] gmail.com>
when adding a new contact using this code: my $new_contact = $cc->newContact('jdoe@example.com', { FirstName => 'John', LastName => 'Doe', ContactLists => '4', }); i get this error: Contact creation request returned code 400 Bad Request at /usr/lib/perl5/site_perl/5.8.8/Email/ConstantContact.pm line 250 should ContactLists be the list name? or list id? what would happen if that contact already exists? would it just be updated? have a good one, brad simmons
Brad, ContactLists needs to be an array reference of ContactList objects. So you can either create new lists, open existing lists directly, or iterate through all the lists until you find the ones you want. Once you have the list objects, pass them along in your newContact() call. Attempting to add an already-existing contact will probably result in an error. You should attempt to getContact() first, and if the contact is found, modify and save() them. Otherwise, proceed with newContact(). Adam On Sat Apr 10 09:38:59 2010, brad.simmons@gmail.com wrote: Show quoted text
> when adding a new contact using this code: > > my $new_contact = $cc->newContact('jdoe@example.com', { > FirstName => 'John', > LastName => 'Doe', > ContactLists => '4', > }); > > i get this error: > > Contact creation request returned code 400 Bad Request at > /usr/lib/perl5/site_perl/5.8.8/Email/ConstantContact.pm line 250 > > should ContactLists be the list name? or list id? > > what would happen if that contact already exists? would it just be
updated? Show quoted text
> > have a good one, > brad simmons
Subject: Re: [rt.cpan.org #56465] adding a new contact
Date: Thu, 15 Apr 2010 23:10:45 -0500
To: bug-Email-ConstantContact [...] rt.cpan.org
From: brad simmons <brad.simmons [...] gmail.com>
thanks. i got it working. great module. have a good one, brad simmons On Thu, Apr 15, 2010 at 12:01 PM, Adam Rich via RT < bug-Email-ConstantContact@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=56465 > > > > Brad, > ContactLists needs to be an array reference of ContactList objects. So > you can either create new lists, open existing lists directly, or > iterate through all the lists until you find the ones you want. Once > you have the list objects, pass them along in your newContact() call. > > Attempting to add an already-existing contact will probably result in > an error. You should attempt to getContact() first, and if the contact > is found, modify and save() them. Otherwise, proceed with newContact(). > > Adam > > > > On Sat Apr 10 09:38:59 2010, brad.simmons@gmail.com wrote:
> > when adding a new contact using this code: > > > > my $new_contact = $cc->newContact('jdoe@example.com', { > > FirstName => 'John', > > LastName => 'Doe', > > ContactLists => '4', > > }); > > > > i get this error: > > > > Contact creation request returned code 400 Bad Request at > > /usr/lib/perl5/site_perl/5.8.8/Email/ConstantContact.pm line 250 > > > > should ContactLists be the list name? or list id? > > > > what would happen if that contact already exists? would it just be
> updated?
> > > > have a good one, > > brad simmons
> > > >