cancel
Showing results for 
Search instead for 
Did you mean: 

Can same email address used repetitively?

CTCT Employee

Re: Can same email address used repetitively?

Hi.

 

That is what the script I posted above does.  If the contact is new, it adds them.  If the contact exists already, it updates them to make sure they are added to a list in the account.

 

Sorry, but I don't have any Java examples of this.

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Contributor

Re: Can same email address used repetitively?

I'm using following for PUT method, giving 415 error. What's wrong with it? Thanks!

 


URI: https://api.constantcontact.com/ws/customers/testUser/contacts/212

 

Body:

 

<entry xmlns="http://www.w3.org/2005/Atom">
    <link href="/ws/customers/testUser/contacts/212" rel="edit"></link>
    <id>http://api.constantcontact.com/ws/customers/testUser/contacts/212</id>
    <title type="text">Contact: test@exampl.com</title>
    <updated>2013-03-01T20:23:39.599Z</updated>
    <author>
      <name>Constant Contact</name>
    </author>
    <content type="application/vnd.ctct+xml">
      <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/testUser/contacts/212">
        <Status>Active</Status>
        <EmailAddress>test@exampl.com</EmailAddress>
        <EmailType>HTML</EmailType>
        <Name>test1, testF</Name>
        <OptInTime>2013-02-28T23:58:57.777Z</OptInTime>
        <OptInSource>ACTION_BY_CONTACT</OptInSource>
        <Confirmed>true</Confirmed>
        <InsertTime>2013-02-28T23:58:57.777Z</InsertTime>
      </Contact>
    </content>
  </entry>

Moderator

Re: Can same email address used repetitively?

A 415 error typically comes from an invalid content-type header, or not setting one. You'll need to set it as

Content-type: application/atom+xml

 If you currently have that set, just let us know, and we can take a deeper look.

Nick Galbraith
Support Engineer
Highlighted
Occasional Participant

Re: Can same email address used repetitively?

Thanks that worked! Ok,

1) So when I update the  contact(existing email) with different details will it be seding confirmation email again to the user or not?

2) When update happens will it override existing details?

3)  I want to update existing contact only when it's not there in list but registered. But when it's in the list not yet exported then I don't want to update. What can I do for this? This is very very importatnt for my clients. Please let me know if you need clarification on this.

 

Thank you so much for your help on this!

CTCT Employee

Re: Can same email address used repetitively?

Hi,

 

I'm glad you got this working.

 

1.  If you set the Opt in source to ACTION_BY_CONTACT, then the user will get an update notification but not a welcome email, since they've already received that once when they first subscribed.  If you set the opt in source to ACTION_BY_CUSTOMER, no emails will be sent.

 

2.  Yes, you will override existing contact details when you use the update function.

 

3.  It sounds like you need to build in logic to check if the user is registered or not before you use the update function.

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Contributor

Re: Can same email address used repetitively?

Thanks for you reply!

 

Re. #3,  I'm checking whether registered or not, but what do I need to do for checking whether it's there in active list or not?

 

I would need some of the other info so soon. Is there a way I could reach you guys? Please let me know. Thanks!

Honored Contributor

Re: Can same email address used repetitively?

Hello!

 

For #3 you can submit a GET request in this format to our API in order to check if a contact exists and is active:

https://api.constantcontact.com/ws/customers/{username}/contacts?email={email-address} 

 

If successful, this request will return limited details of the contact or fail if the email address does not match a contact on your account. You can find more information about this request here: 

http://community.constantcontact.com/t5/Documentation/Searching-for-a-Contact-by-Email-Address/ba-p/...

 

As a side note, you can then pass another request for more detailed information to our API using the contact's ID and the request format specified here: http://community.constantcontact.com/t5/Documentation/Obtaining-a-Contact-s-Information/ba-p/25057

 

 

In addition, if you do need to be able to speak with someone from our API support team, you would need to send an email to webservices@constantcontact.com and let us know what date/time is best for you. We will be sure to get back to you and let you know if there's a scheduling conflict or if we can connect at that time.

 

Sincerely,

Elijah G.

Tier 2 Support

Elijah G.
API Support Engineer
Tags (1)