Updating CC server with email contact

Regular Participant

Updating CC server with email contact

I have question on using CCSFG_0.0.6.

 

So this is basically for generating 'registration form’ and updating CC Server/DB with that particular email contact.

 

In my case,

 

I have my own registration form developed in Java (same way how CCSFG_0.0.6 generates) and with this I have collected all user data, then how can I update CC Server with this data?

 

1)Can I update CC servers directly with request? Or need to go through CCSFG_0.0.6 files to update CC servers?

 

2) If I can do it directly can please point me to correct API? Or is there any request format that I can follow.

 

Provide me anything related to this.

 

Please help me out. Thank you!!

12 REPLIES 12
Regular Participant

Can anyone help me out please?? Thanks!!

Hello,

 

Yes, the CCSFG creates a form and  includes an integrated library with functions that create contacts using a POST request.  There is a special version of the CCSFG available upon request that will check first if a contact already exists in your account (on any status or list, including removed  or do-not-mail), and will update those using the rquired PUT request, bu this is available only be request.  Rather than reverse engineering the CCSFG, if you already have a signup form, I would recommend using one of our Wrapper Libraries. These can be found by clicking the Code Samples link near the top of this page. At this time, we do not have a supported JAVA library, but there is an open-source library you may find which includes the functions you need, but if you have issues with it, you will have to seek support from the open-source community at large.

 

If you are writing your own HTTP request functions, the documentation for our API which specified the method required for each type of API Request, and what must be included in the Header and Body of the request (if anything), can be found by clicking the API Documentation link at the top of this page.  Creating a new contact (one that has never  previously been added to the account), is done via POST request, Updating existing contact records (when contacts have previously been added, and even if they have been "removed") is done with a PUT request, and a DELETE request is used to move contacts to "do-not-mail/unsubscribed" status.

Mark Coleman
Support Engineer
Regular Participant

Thanks for response!! let me make sure If I understood correctly.

 

1) So I can send direct HTTP POST OR GETrequest to CC servers from own developed form. correct?

2) Inorder to know format of the HTTP request  or variables required to include, I need to follow following link. correct?

http://community.constantcontact.com/t5/Documentation/Creating-a-Contact/ba-p/25059

Hello,

 

You cannot make a POST request directly from your form to our API, because it is not possible to send the form data in formatted XML from an HTML form. Posting directly from an HTML form with authentication data included, as required by our API would also make your account data more vulnerable to exploitation by third parties. So, you would need your HTML form to submit it's data to a script hosted on your web host/server which would then attach the authentication, create the XML for the POST body, and then make the properly formatted POST request.  We have some wrapper libraries available from the links provided on our Code Samples page (see link at the top of this page), and these can make your part of the coding a little easier, by handling the creation of a contact object, conversion to XML, and creating the API request.

Mark Coleman
Support Engineer
Regular Participant

Thanks for reply!! I appreciate it.

Yes directly from form I mean from my server which has form data, which is authenticated and validated, then post it to CC server with post request which is in xml format.

Final question.. from your answer.

 

So, you would need your HTML form to submit it's data to a script(which is in Java in my case) hosted on your web host/server which would then attach the authentication, create the XML for the POST body, and then make the properly formatted POST request.

1) So I can post directly from java class(which is server side) with xml content- type. correct?

 

2) Before posting a request or preparing request, would it needs to use your Wrapper classes(as mine is Java class)??

 

 

(code samples page is so confusing for my need)

 

Hello,

 

In response to your questions:

 

Yes, you can post directly using a java class. Content type should be "application/atom+xml" for your http request, as specified in our documentation under the Contacts heading. The data then need to be included in the body of your request as xml consistent with Atom XML standards (see examples in our documentation).

 

You do not need to use our wrapper classes. You can use any class that support HTTP requests of GET, POST, PUT, and DELETE to accomplish all functions possible through out API.  We also do not currently have an updated Java wrapper that can support, although there is one available as an open-source project that you may find if you search. If you find and use this class, you will need to seek support from the open-source community at large.

 

I hope this information is helpful to you. Let me know if you have any more questions.

 

 

Mark Coleman
Support Engineer
Regular Participant

I would like to talk with one of you guys. Can I know any number? Thanks!!

Our API support team does not have a direct call in number, we aren't able to support live call coverage for this topic.  However, our API support team can certainly schedule a call with you.  I think you and Mark are really on the same page here, just not understanding each other.  If you send an email to webservices@constantcontact.com with your contact information and what times are good for you, we can definitely get a call scheduled.

 

To potentially mitigate that call, here's an overview from a Java point of view on how you'd implement this:

 

1. Your website form posts back to your Java endpoint (JSP, Servlet, etc., doesn't matter what)

2. You Java class(es) process the data and validate your request

3. If the request is valid, you can use the HttpClient class to send an Authenticated POST/PUT/GET request with the valid XML to our API (see the documentation you already have for details on that)

 

Using our API will simply end up being another step you do on the server when processing these form submissions.  I would recommend looking at the open source Java library out on Github as it may save you a lot of time parsing XML.

 

Dave Berard
Senior Product Manager, Constant Contact

Hi,

 

Just to be clear, I'm referring to authentication of the request, meaning some form of data submitted with the request to indicate to our Systems that your application script/application has permission to access your Constant Contact Account's data. You would need for the authentication data to be stored securely on your server for use in making your API requests (see Authentication Docuementation).

 

Cheers,

Mark Coleman
Support Engineer
Regular Participant

Ok by considering authentication, what is your comment on above questions?

Developer Portal

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

Visit Page