Hi Akhilesh -
The API is exposed as a set of URLs, custom to your account, which contain data for your account. There is a URL which returns the set of lists for your account, a URL which returns the set of Campaigns in your account and so on. To simply "read" data in your account, your program invokes an HTTP GET request (just like a browser would). To Update existing information, your program must issue an HTTP PUT request. To create new data, you ISSUE a POST command and to delete data you issue an HTTP DELETE request. You can invoke an HTTP request using different libraries, depending on your development environment.
There are basically four steps to perform when using the API:
1. Construct the required access control credentials which are needed to access the data. This is described, and then shown in a code example, in the API Authentication section of
this page.
2. Determine the Specific URL which contains the data you want to update. These are the "URIs" referenced above. You can generally start at the top:
http://api.constantcontact.com/ws/customers/joesflowers/lists
will return the set of lists for the the "joesflowers" constant Contact account
3. Construct or modify an XML description of the object you want to create or modify. (In the case of a DELETE, no data is required). The XML structure for a list is shown
here.
4. Using whatever library or approach you desire, invoke the HTTP (GET/PUT/POST/DELETE) with the header information (credentials and content-type) for the object you are modifying and the body (XML) you are sending.
This basic flow is shown in several examples on this site, including this
PHP example, which uses CURL to invoke the HTTP calls.
Tom M
Group Product Manager – Content Editing
Constant Contact