Constant Contact C# Tutor is a complete app written in C#, demonstrating integration with the Constant Contact Web Services API.
This code is provided as-is. You are free to copy and reuse it, but it does not carry any warranties, implied or otherwise.
This sample application requires the Microsoft .NET 4 Framework to run.
Since the app integrates with the Constant Contact Web Services API, you will need Constant Contact login credentials. These can be obtained by signing up for a free trial from www.constantcontact.com. A Constant Contact API key is also required, obtainable at http://community.constantcontact.com/t5/Documentation/API-Keys/ba-p/25015. There is also a link to the Constant Contact API document containing instructions on how to obtain an API key provided on the Login Panel in this app.
- A compiled version of the sample app can be downloaded from the
- Source code is provided in the
What is Constant Contact C# Tutor?
Constant Contact C# Tutor is a small application developed in .NET that is intended to demonstrate how to use the Constant Contact Web Services API. It contains basic examples of API calls including GET, POST, PUT, and DELETE. Besides the actual call, the application intercepts and displays the HTTP request/response in order to show what happens beneath the covers.
After cloning the git repo and navigating to the
/App directory, go ahead and run
Click on the Get Started button. This action will display the login control and the request/response display panels. A Restart button is provided to start the API calls from beginning.
The login API call attempts to access the Constant Contact main API page. The user will need to provide their Constant Contact user name, password, and API key.
List API Calls
After login, the user has the ability to perform API calls to retrieve their email lists, add a new list, or remove an existing one. There are three buttons to perform these actions:
- Load existing lists – populates the right side list-control with all of the email lists for the current user.
- Add new list – displays a pop up window where the user can enter a name for the new list.
- Remove selected list – removes the selected list from the email list collection.
The user will see in the request/response display panels what happens behind the scenes for each action.
A link that will guide the user to the relevant Constant Contact API documentation page is provided below each button.
Show Contacts in list
After selecting a contact list from the panel, press this button to display the contacts contained in that list.
The underlying Web Services API call is shown in the request/response panels.
There is a link to the Constant Contact API documentation for this action below the button.
Update selected contact
Use this button to update the customer name. This button will become active if the email list contains contacts.
There is a link to the API documentation for this call next to this button.
This button will return the user to the List API Calls panel.