webservices

Code Samples

by Administrator on ‎03-25-2011 09:23 AM

Transitioning to AppConnect 2

 

We have released our new, better API, and along with it, new code samples and wrappers. If you're just starting off developing with us, or you'd like to move your apps over to the new API, please check our our new sample code page or download the v2 wrappers located on our GitHub page (description will say SDK for v2). If you are already working with v1, and just need some references, we've kept the page below intact.

 

V1 API Code Samples

 

If you are looking for a custom signup form for your website, please check out our Constant Contact Signup Form Generator, which does not require any programming to generate a customizable signup form!

 

Are you looking for VB.NET samples?  Try the .net code converter!

 

We use Github to host our repositories. To download all the files as a ZIP, click the gray ZIP icon near the top left of the page.

 

Constant Contact Libraries

 

These libraries wrap around all of Constant Contacts API functionality, giving you easy to use classes which will save you time and effort in developing your integration.

ColdFusion Wrapper Library - Compatible with ColdFusion 9, ColdFusion 8 Beta available

PHP Wrapper Library - Compatible with PHP 5+

C#.NET Library - Compatible with .NET 2.0+

 

PHP OAuth2 Example - Use this if you are having trouble authenticating using OAuth2 (or just want a simple example of how to do it)..

 

Sample Contact Upload/Signup Forms

Many developers like working with the sample codes because they provide a working example of how best to integrate with Constant Contact's API's.  In order to better illustrate these examples, we have created these sample codes for contact upload forms in PHP and .NET (C#).

 

These sample forms provide the following features:

  • Add a new contact
  • Update an existing contact
  • Sign up form that either adds a contact if new or updates a contact if exists
  • List all contacts, with options to edit a contact, or to remove contacts from all lists, as opposed to opt-out
  • Ability to display in the signup forms all of your contact lists or only the ones you want to display

We are providing you with these sample forms as a starting point to create your own signup forms.  We provide two different type of forms: a full form that contains all possible updatable fields, which you can trim down to leave those only you want, or a simple form, which has a limited set of fields that we felt you would want the most.  You can start with either form and create your own by removing fields you do not want in your signup form.  You can also modify the contact lists that are displayed on these forms.

We hope you find these sample codes useful, and please let us know if you have any feedback on the Support Forums.

 

DISCLAIMER:

We provide these sample codes to demonstrate our API's capabilities and use cases, but they are provided as is, without any guarantees that they will work in all system configurations and different versions of software.  We have tested them in our environments and they worked for us, but we expect you to have proper technical knowledge to address any system or coding issues that arise from using these sample codes.  

 

PHP Sample Forms

 

Public Repository: PHP Sample Contact Forms

 

To learn how to use the above sample upload forms, refer to the documentation for PHP sample forms.

 

.NET (C#) Sample Forms

 

Public Repository: .NET Sample Contact Forms

 

To learn how to use the .NET sample upload forms, refer to the documentation for .NET sample forms.

 

ColdFusion Sample Forms

 

Public Repository: ColdFusion Sample Contact Forms

 

To learn how to use the ColdFusion sample upload forms, refer to the documentation for ColdFusion sample forms.

 

Sample Campaign Forms

 

To demonstrate what our campaign APIs can do, we have created the following sample forms in PHP and C#.  For more details about what the campaign APIs can do and what their limitations are, please refer to documentation on how to use campaign APIs.  These sample codes share the same core code as the contact singup forms above and provide the following features:

  • Create a new campaign (custom code campaign only)
  • Edit an existing campaign (content editing available only for custom code campaign)
  • List all campaigns
  • Search for campaigns by status
  • Remove a campaign
  • View campaign report statistics

We hope you find these sample codes useful, and please let us know if you have any feedback on the Support Forums.

 

DISCLAIMER:

We provide these sample codes to demonstrate our API's capabilities and use cases, but they are provided as is, without any guarantees that they will work in all system configurations and different versions of software.  We have tested them in our environments and they worked for us, but we expect you to have proper technical knowledge to address any system or coding issues that arise from using these sample codes.  

 

PHP Sample Forms

 

Public Repository: PHP Sample Campaign Forms

 

To learn how to use the above sample upload forms, refer to the documentation for PHP sample forms.

 

.NET (C#) Sample Forms

 

Public Repository: .NET Sample Campaign Forms

 

To learn how to use the .NET sample upload forms, refer to the documentation for .NET sample forms.