How To Use RESTClient

webservices
Administrator

Initial Setup

 

First, download and install the RESTClient from the following URL:

 

http://rest-client.googlecode.com/

 

Next, we need to set up the authentication information.  On "Auth" tab, check "BASIC" and uncheck "Preemptive".

For "Username", enter {API KEY}%{Constant Contact username}.  For "Password", enter your Constant Contact password.

 

AuthTab.jpg

 

Using RESTClient

 

You will mostly work with "Method", "Headers" and "Body" tabs.  Choose the appropriate method on "Method" tab.

If you are using a GET method, then you don't need to use "Headers" or "Body" tab.  If you are using a PUT or a POST, then put your XML in "Body" tab and add application/atom+xml as "Content-Type" header on "Headers" tab.  If you are trying to run a GET method followed by PUT or POST, you do not need to delete the contents of "Headers" and "Body" tabs.  They will be promptly ignored.

In URL, enter your API call like the following:

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

Don't forget to use "https" instead of "http".

 

Examples

 

All examples assume your {username} is testuser.

 

1. Getting a list of contacts

  • On "Method" tab, choose "GET"
  • In URL, enter https://api.constantcontact.com/ws/customers/testuser/contacts
  • Hit the Go! button with ">>" icon
    • The REST Client will display a response status (which should be 200 OK) in the lower pane
    • If the call was successful, see the BODY tab of the lower pane to inspect the response body.  (The Response Body from your GET is generally very useful in putting together a Request Body for a create (POST) or update (PUT) command)

GetExample.jpg

 

2. Creating a new contact list

  • On "Method" tab, choose "POST"

 

    PostExample1.jpg

     

  • On "Headers" tab, enter Content-Type as "Key" and application/atom+xml as "Value" and hit the plus button to add it.

 

    PostExample2.jpg

     

    PostExample3.jpg

     

    On "Body" tab, enter your XML entry for the new contact list

  • <entry xmlns="http://www.w3.org/2005/Atom">
    <id>data:,</id>
    <title/>
    <author/>
    <updated>2008-04-16</updated>
    <content type="application/vnd.ctct+xml">
    <ContactList xmlns="http://ws.constantcontact.com/ns/1.0/">
    <OptInDefault>false</OptInDefault>
    <Name>A New List</Name>
    <SortOrder>99</SortOrder>
    </ContactList>
    </content>
    </entry>

    PostExample4.jpg

Community Knowledge Base

Learning & Resources

We take questions asked by customers on the Community and expand on them to help you find answers fast, getting you back to using Constant Contact's suite of amazing tools in no time.

Read More

  • Avatar

    Support Tips

    Social Media

    "There's a multitude of ways to engage your audience through us using your social platforms - via ads, social post metrics, email links, and more! " - Will

    See Article
  • Avatar

    Support Tips

    Call-To-Action Links

    "Target your most engaged contacts by creating a segment. Create a special offer or show your appreciation!" - Caitlin

    See Article
  • Avatar

    Support Tips

    Welcome Your Audience

    "Greet new contacts with one or more automated Welcome Emails depending on their interests or your business goals." - Nick

    See Article