Signup Form Embed Code

Use this HTML code to add contacts to an account by sending a POST request. The form is based on the Embed Code in the Sign-Up Tools area of your Constant Contact account.

NOTE: This embed code doesn't use the v2 API or the standard authentication employed by our API. Authentication is achieved by validating the ca-ID included in the request over HTTPS.

Methods:

Click a method to view its documentation

POST

DescriptionTOP

The HTML code for a sign-up form is accessed by selecting Embed Code for a sign up form in the Sign-Up Tools area of the account.

Locating signup form embed code

The HTML contains a ca-ID that links each call to an account.

HTML for JMML embed code

Where to find the ca-ID

The ca-ID is located in the Embed Code below. If you have multiple sign-up forms, any of them will work.

<!-- The following code must be included to ensure your sign-up form works properly. -->
<input data-id="ca:input" type="hidden" name="ca" value="d4d07170-96ab-49ef-86cb-6b60954c1169">

Limits

Rate Limits - The signup URL can handle 500 subscriptions during a rolling 24 hour period for each ca-ID. This limit can't be adjusted--if you need to add more than 500 contacts per day through a form, you must use our full contacts API.

Field Limits - You can find the maximum characters allowed for each field in the embed code.

<p data-id="Street Address:p" ><label data-id="Street Address:label" data-name="address_street">Street</label> <input data-id="Street Address:input" type="text" name="address_street" value="" maxlength="50"></p>

How to Submit Data

The Embed Code you receive through the product can be used as-is. If you decide to modify it, you may either submit the data by appending the key-value pairs to the URL, or by sending a JSON payload with the key-value pairs. We've written more on how to modify Embed Code and how to use the post URL.

Best practices

In order to ensure the best experience for folks subscribing, please consider the following suggestions.

  • Error messages - Record any error message body received back from us, and provide the appropriate feedback to the user trying to subscribe to your account. For example, if we give you a 400 error, the error message body might say the email address was invalid. Display that message to help you and your contacts figure out what went wrong.
  • Success page - Create a page that tells the user they've successfully subscribed. Enter the URL for this page in the url field so they see your customized 'Thank you for signing up' message.
  • Keep the signup form current - Be aware that the lists specified need to remain in the account. If a list is deleted, the signup form should be updated.

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

name

type

default

description

address_city

path

City the contact lives in.

address_country

path

Standard ISO 3166-1 2-letter country code for the contact

address_postal_code

path

The contact's Postal ZIP code.
NOTE: For postal codes that contain white space between characters, the characters after the first white space are broken out into the sub_postal_code field.

address_state

path

State that the contact lives in.

address_street

path

The contact's street address

anniversary_day

path

Must include anniversary_year and anniversary_month when using anniversary_day. The day of the contact's anniversary, accepts numbers 1 - 31.

anniversary_month

path

Must include anniversary_year and anniversary_day when using anniversary_month.The month of the contact's anniversary, accepts numbers 1 - 12.

anniversary_year

path

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

path

Must include birthday_month when using birthday_day. The day of the contact's birthday, accepts numbers 1 - 31.

birthday_month

path

The month of the contact's birthday, accepts numbers 1 - 12.

ca

path

REQUIRED Campaign Activity ID that identifies and authenticates the Constant Contact account owner

company

path

The contact's company

email

path

REQUIRED The contact's email address, must comply with RFC 5322.

first_name

path

The contact's first name

job_title

path

The contact's job title

last_name

path

The contact's last name

list, lists, list_n

path

Specifies the list_id that the contact will be subscribed to. If your form will have multiple lists, you can differentiate each list using list_1, list_2 ... If blank, the contact is added to the list(s) configured with the signup form in the product UI.

phone

query

The contact's home phone number

url

path

URL to redirect the subscriber to after submitting subscription. This feature will only work if the javascript and 'success' span section are removed from the Embed Code.

Response CodesTOP

code

description

200

Contact was successfully created

400

Either JSON was malformed or there was a data validation error, see error message for details.

401

Authentication failure

429

Sorry, our signup volume is too high. Please try again later.