The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

CCSFG: Constant Contact Signup Form Generator issue

Highlighted
Occasional Contributor

CCSFG: Constant Contact Signup Form Generator issue

Great work on the POST API. I do have a couple issues with it though: 

 

1. Notes are not passed. any reason or any special cases to get this working?

 

2. State / Country Combo? why limit this. For example, If I send in "Michigan" with the country listed as "Bahrain". it will not work correctly as the form will not send a state / otther country combination. I know this is a unique situation and not common but we run an "expat tax service" and our customer put what state they are originally from and what country they live in now so its usually almost always the case.

 

3. When I do not send a state / country but it is included as a paramater, the user is not added to the mailing list. Not sure why this is the case.

 

Thank You and Great work. these should be my last issues so I am excited to get this part of our project completed :)

 

-Sam

 

7 REPLIES 7
Highlighted
Occasional Contributor

Re: CCSFG: Constant Contact Signup Form Generator issue

any idea on these?

Highlighted
Employee

Re: CCSFG: Constant Contact Signup Form Generator issue

Hey,

 

Thank you for your feedback.

 

1).  I believe you are referring to the notes part of your contact details.  This is used to gather notes about your specific contact and not for anything else.  They dont show up in emails as you could make a really big mistake really easily if you put some notes about a contact and then accidentailly emailed the contact those notes about them.

 

2). The State / Country combo checks against the United States information and we are always implementing changes to help better support our users outside of the US as well.  In the meantime I would suggest using CustomFields to hold State / Country.

 

3).  This is very likely due to the system checking against our list of states and since yours wouldnt be listed, then it would return a 400: Bad request error.  By using the custom fields you would be able to avoid this as well.

 

Please let me know if this helps.

 

Ryan Davis
Quality Engineer
Highlighted
Occasional Contributor

Re: CCSFG: Constant Contact Signup Form Generator issue

Sounds Good.

 

Thank You for the very quick reply. A+++ Support!

Highlighted
Occasional Contributor

Re: CCSFG: Constant Contact Signup Form Generator issue

I have one more question, I want to feed in comments that customers put in our form in to the" Notes" Field using the POST api you guys have in PHP, is that possible?

 

-Sam

Highlighted
Occasional Contributor

Re: CCSFG: Constant Contact Signup Form Generator issue

2. I would implement them as custom fields but I filled them up already ;)

 

3. For the states / country combo, your right, I do get a Bad Request on those and that is the reason, I did trace it and that is what I get back.

Highlighted
Employee

Re: CCSFG: Constant Contact Signup Form Generator issue

Hey,

 

You can add to the notes field but you cant call back to them from our product to insert into an email.  I know you didnt ask but it is important to know in case you implement dynamic data. This would be an example of how to create the contact with a note field.

 

POST: https://api.constantcontact.com/ws/customers/{username/contacts
<entry xmlns="http://www.w3.org/2005/Atom">
  <title type="text"> </title>
  <updated>2008-07-23T14:21:06.407Z</updated>
  <author></author>
  <id>data:,none</id>
  <summary type="text">Contact</summary>
  <content type="application/vnd.ctct+xml">
    <Contact xmlns="http://ws.constantcontact.com/ns/1.0/">
      <EmailAddress>my@example.com</EmailAddress>
      <OptInSource>ACTION_BY_CONTACT</OptInSource>
      <Note>This is where you would put your note, it is limited to to 500 characters</Note>
      <ContactLists>
        <ContactList id="http://api.constantcontact.com/ws/customers/{username}/lists/1" />
      </ContactLists>
    </Contact>
  </content>
</entry>

 Updating a contact is the same concept but you do a PUT vs a POST.  It is important to know if someone does this process twice the first entry would be overwritten:

 

GET: https://api.constantcontact.com/ws/customers/{username}/contacts?email=theemail@this.com

 Take result and parse the ID so you can do a get to the Contact Collection

GET: https://api.constantcontact.com/ws/customers/{username}/contacts/{id}

 I would store all of the nodes as variables so youc an PUT the collection back when you do your PUT to do the update

PUT: https://api.constantcontact.com/ws/customers/{username}/contacts

 The information will look something like:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <link href="/ws/customers/{username}/contacts/81039" rel="edit"></link>
  <id>http://api.constantcontact.com/ws/customers/{username}/contacts/81039</id>
  <title type="text">Contact: my@example.com</title>
  <updated>2011-11-08T19:40:10.811Z</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/{username}/contacts/81039">
      <Status>Active</Status>
      <EmailAddress>my@example.com</EmailAddress>
      <EmailType>HTML</EmailType>
      <Name> </Name>
      <FirstName></FirstName>
      <MiddleName></MiddleName>
      <LastName></LastName>
      <JobTitle></JobTitle>
      <CompanyName></CompanyName>
      <HomePhone></HomePhone>
      <WorkPhone></WorkPhone>
      <Addr1></Addr1>
      <Addr2></Addr2>
      <Addr3></Addr3>
      <City></City>
      <StateCode></StateCode>
      <StateName></StateName>
      <CountryCode></CountryCode>
      <CountryName></CountryName>
      <PostalCode></PostalCode>
      <SubPostalCode></SubPostalCode>
      <Note>This is where you would put your note, it is limited to to 500 characters</Note>
      <CustomField1></CustomField1>
      <CustomField2></CustomField2>
      <CustomField3></CustomField3>
      <CustomField4></CustomField4>
      <CustomField5></CustomField5>
      <CustomField6></CustomField6>
      <CustomField7></CustomField7>
      <CustomField8></CustomField8>
      <CustomField9></CustomField9>
      <CustomField10></CustomField10>
      <CustomField11></CustomField11>
      <CustomField12></CustomField12>
      <CustomField13></CustomField13>
      <CustomField14></CustomField14>
      <CustomField15></CustomField15>
      <ContactLists>
        <ContactList id="http://api.constantcontact.com/ws/customers/{username}/lists/1">
          <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/{username}/lists/1" rel="self"></link>
          <OptInSource>ACTION_BY_CONTACT</OptInSource>
          <OptInTime>2011-11-08T19:40:10.649Z</OptInTime>
        </ContactList>
      </ContactLists>
      <Confirmed>true</Confirmed>
      <InsertTime>2011-11-08T19:40:10.564Z</InsertTime>
      <LastUpdateTime>2011-11-08T19:40:10.811Z</LastUpdateTime>
    </Contact>
  </content>
  <source>
    <id>http://api.constantcontact.com/ws/customers/{username}/contacts</id>
    <title type="text">Contacts for Customer: apisupport</title>
    <link href="contacts"></link>
    <link href="contacts" rel="self"></link>
    <author>
      <name>apisupport</name>
    </author>
    <updated>2011-11-08T19:43:50.015Z</updated>
  </source>
</entry>

 

Please let me know if this helps.

 

Ryan Davis
Quality Engineer
Highlighted
Employee

Re: CCSFG: Constant Contact Signup Form Generator issue

I should mention that the notes field is inside of CCSFG which would allow you to enter on the creation of the customer.  But the search and replace would not.  

Ryan Davis
Quality Engineer
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured