cancel
Showing results for 
Search instead for 
Did you mean: 

New Contact Signup POST URL [DEPRECATED]

Moderator

New Contact Signup POST URL [DEPRECATED]

NOTE: The signup form described here was deprecated in 2017. Existing forms will still work, but users are no longer able to view the CA ID in the product UI. 

 

We’ve gotten feedback that users want a simple way to add contacts into their Constant Contact account without having to redirect the contact to our website to finish the process. This method keeps the contact on your page and doesn’t require advanced programming knowledge.

You can now add contacts directly into your account from your webpage or application using this simple post URL. You can also use the embed code as it is, and paste it into your website. That’s found by logging in and going to Contacts>>Sign-up Tools>>Embed Code.

 

 

embed_code.png

 

This article focuses on constructing the raw request, and is for our very technical users with HTML and CSS coding experience. In order to use the POST URL, your web page or application must be able to make a HTTPS call to the following URL:

 

https://visitor2.constantcontact.com/api/signup

 

Authentication

 

Our signup URL doesn’t require the use of an API Key or access token, and doesn’t use the OAuth 2 flow used by our API endpoints.

The “ca” value identifies the account to which to add the new contact. This property is unique for each Constant Contact account. As such, this is not a suitable solution for multi-user applications.

You can find the “ca” value for an account by logging in and going to Contacts>>Sign-up Tools>>Embed Code. Copy the embed code, and find the “ca=” parameter. Paste the value that follows into your sign-up form URL. If you have multiple embedded sign-up forms in one account, any of the “ca” values will work.

 

Where to find the ca id

 

The ca id is shown in the embed code like this. It is the hashed string after “value.”

 
<!-- The following code <span class="hiddenGrammarError" pre="code " data-mce-bogus="1">must be</span> included to ensure your sign-up form works properly. -->
<input data-id="ca:input" type="hidden" name="ca" value="12345-678-910">
  

Contact fields

 

The new POST URL supports a number of fields that users can choose to fill in when subscribing. A visitor is only required to fill in the email field. The following table lists the fields supported by the POST URL.

 

Name Required Description
address_city   City the contact lives in.
address_country   The contact's country; Standard ISO 3166-1 2-letter country code
address_postal_code   The contact's Postal ZIP code.
address_state   State that the contact lives in.
address_street   The contact's street address
anniversary_day   Must include anniversary_year and anniversary_month when using anniversary_day. The day of the contact's anniversary, accepts numbers 1 - 31.
anniversary_month   Must include anniversary_year and anniversary_day when using anniversary_month.The month of the contact's anniversary, accepts numbers 1 - 12.
anniversary_year   Must include anniversary_day and anniversary_month when using anniversary_year.The year of the contact's anniversary, accepts numbers 1900 and higher, up to 10 years in the future.
birthday_day   Must include birthday_month when using birthday_day. The day of the contact's birthday, accepts numbers 1 - 31.
birthday_month   The month of the contact's birthday, accepts numbers 1 - 12.
ca Yes Campaign Activity ID that identifies and authenticates the Constant Contact account owner. Retrieve this value by logging in your Constant Contact account and going to Contacts>>Sign-up Tools>>Embed Code, and look for ca ID.
company   The contact's company
email Yes The contact's email address, must comply with RFC 5322.
first_name   The contact's first name
job_title   The contact's job title
last_name   The contact's last name
list   Array of list_ids that the contact will be subscribed to. If blank, service uses the lists configured with the signup form in the product UI.
phone   The contact's home phone number
url   URL to redirect the subscriber to after submitting subscription. If blank, endpoint returns a 200 Success response.

 

For example, your sign-up form can make a POST request to the URI below to specify the email address being added, their first name, and the lists you want them added to.

 

https://visitor2.constantcontact.com/api/signup?ca=xxxxx
&email=example@madeupdomain.com&first_name=Joe
&list=xxxx&list=xxxxx

 

Adding new contacts to your lists

 

The lists parameter specifies the list(s) to which to add the new contact. Specify multiple lists by including the list parameter multiple times. If no lists are specified in the URL, the contact is added to the lists that you specified when you set up the sign-up form in the product UI.

If a contact that is submitted using the POST URL already exists in your account, the POST updates their record with the information included using this method. They will not be removed from any lists that they are already subscribed to; the effect of this will be additive. Similarly, any fields not sent into us in the request will remain in the contact record.

 

Possible responses from our service

 

Condition Status Content
Contact created/updated successfully 200 Welcome page (customizable)
Missing parameter 400 Error page: "Missing required field: ..."
Invalid e-mail address 400 Error page: "Invalid e-mail address..."
Rate limit exceeded 429 Error page: "Sorry, our signup volume is too high. Please try again later."*

 

* Note that this is for security. Each account is limited to 100 submissions per 24-hour period, on a revolving timer.

The character limits on contact fields are defined here, in addition to being in the embed code.

 

Best practices

 

  • Be aware that the lists specified need to remain in the account. If a list is deleted, the sign-up form should be updated.
  • Record any error message body received back from us. For example, if we give you a 400 error, that error code is accompanied by a reason, like that the email address was invalid. Display that message to help you and your contacts figure out what went wrong.
  • Use the url field if you want to the contact to see a customized ‘Thank you for signing up’ message.

Getting Support

 

For support, take a look at all the ways you can get in touch with us. Please note that we can only ensure that you are forming the POST request properly and that the submitted data is in the correct format.

Rich Marcucella
Sr. Technical Writer, Content Developer
Web Services Team
http://developer.constantcontact.com
7 REPLIES
Frequent Visitor

Re: New Contact Signup POST URL

I'm trying to follow the instructions in this article, but it appears that something has changed and it's no longer possible to follow it.

 

When viewing the "Contacts" page in my account, there is no "Sign-up Tools" section.  I can no longer find the embed code needed to find the "ca" value for my request.  Where can I access this information now?

 

Thank you.

Highlighted
Moderator

Re: New Contact Signup POST URL

Hello,

The CA value was a component of our older embedded signup forms. When our Contacts team updated to our new inline signup forms in 2017, this previous method was discontinued. Previously generated forms do still function but there is no longer a way to generate a new CA value.

If you have any questions about our signup forms, please feel free to reach out to our main support team at 866-289-2101.

I will be marking the parent posting here as obsolete.

Sincerely,

Rich Marcucella

 

Rich Marcucella
Sr. Technical Writer, Content Developer
Web Services Team
http://developer.constantcontact.com
Occasional Participant

Re: New Contact Signup POST URL [DEPRECATED]

When I send...

$submissionData['list'] = array('1090243264','1289760758');

...the contact only gets added to the last list. How can I fix this?

Occasional Participant

Re: New Contact Signup POST URL [DEPRECATED]

job_title also doesn't work

Moderator

Re: New Contact Signup POST URL [DEPRECATED]

Hi @TomB02198,

 

Please keep in mind as the subject of this post lists that this method is deprecated so support is very limited.

 

Your lists need to be in an array with each one having a different name. Here is an example:

1. {
2. "contact_lists":["list_id1","list_id2"],
3. "list_name":"list_name",
4. "source":"My App"
5. }

contact_lists : array : Array of Contact List Ids that the new contact will be
added to. REQUIRED if list_name is not specified.

list_name : string (255) : Specifies the name of the list that the new contact will be
added to. The Contact list is created if it does not exist.
REQUIRED if contact_lists are not specified.

Regards,
Jimmy D.
Tier II API Support Engineer
Occasional Participant

Re: New Contact Signup POST URL [DEPRECATED]

Hi Jimmy,

 

Thank you very much. That's significantly helping the charity I work for, with a tight deadline looming.

 

However despite trying I've failed to understand what I should set as $submissionData['list']. Would you illustrate, when the two list IDs are 1090243264 &1289760758?

 

Best wishes,

Tom

Moderator

Re: New Contact Signup POST URL [DEPRECATED]

I'm not sure exactly which language you are using; however if you were to make this a generic http request like the original message says this is what it would look like.

 

https://visitor2.constantcontact.com/api/signup?ca=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&email=email@sample.com&first_name=Joe&list_1=xxxxxxxxxx&list_2=xxxxxxxxxx

Regards,
Jimmy D.
Tier II API Support Engineer
Still need help?
You can post a new message in the Community or find us on Twitter Mon-Fri 8am - 8pm ET. We've got real people waiting to help you out. Click below to start a conversation!