Import Constant Contact Data to Google Sheets

In this guide, we’ll walk through how to pull data from the Constant Contact API directly into Google Sheets, using the API Connector add-on for Google Sheets. We’ll first get an API key from Constant Contact, and then set up a request to pull in email campaign details from your Constant Contact account to your spreadsheet.

PART 1: GET YOUR CONSTANT CONTACT API KEY

  1. Create a Mashery account at https://constantcontact.mashery.com/member/register. Mashery is the system Constant Contact uses to power their APIs.
  2. Log in and register a new application at https://constantcontact.mashery.com/apps/register.
    You can name it anything, but here we’ll name it ‘Google Sheets’. You don’t need to fill in the other form fields, just leave them blank.
    constant-contact-img1
  3. Scroll to the bottom and make sure you’ve agreed to the terms of service. Click ‘Register Application’.
    constant-contact-img2

     

  4. You will now see your API Key.
    constant-contact-img3

     

  5. Click the API Tester tab, and then the Get Access Token button.
    constant-contact-img4
  6. This will take you to an account registration/login page. Assuming you already have a Constant Contact account, click ‘I already have an account’ (otherwise you’ll need to click ‘Create Account’.
    constant-contact-img5
  7. You’ll now be prompted to allow access to the application you just registered (‘Google Sheets’). Click Allow.
    constant-contact-img6
  8. You should now see your Access Token. Keep this handy, as we’ll need it shortly. Congrats, you’re done! You now have access to the Constant Contact API, and can start pulling Constant Contact data into Google Sheets.
    constant-contact-img7

PART 2: CREATE YOUR API REQUEST URL

    1. Constant Contact has made this part very easy. Instead of reading through the API documentation, we’ll just go back to the API Tester tool to get our first API request URL.

      Paste in the access token you just got, then click Get and Try it:
      constant-contact-img12

    2. You’ll see a request URL appear. Copy this.
      constant-contact-img13

 

PART 3: PULL CONSTANT CONTACT API DATA INTO SHEETS


We’re now ready to enter all our values into API Connector.

      1. Open up Google Sheets and click Add-ons > API Connector >  Create New API Request
      2. In the Create Request interface, enter the Request URL we just retrieved.
        constant-contact-img8

         

      3. We can also grab our headers from the API Tester interface:
        constant-contact-img9

         

      4. Under Headers, copy/paste in the Request Header values from above:
        AuthorizationBearer YOUR_ACCESS_TOKEN
        X-Originating-IPYOUR_IP_ADDRESS

        Of course you will need to substitute in your own values. It should look like this:
        constant-contact-img10

      5. Create a new tab. You can call it whatever you like, but here we’ll call it ‘CC_Account’. While still in that tab, click ‘Set’ to use that tab as your data destination.
      6. Name your request. Again we’ll call it ‘CC_Account’
      7. Click Run and a moment later you’ll see your Constant Contact account data populate your Google Sheet:
        constant-contact-img11

 

PART 4: CONSTANT CONTACT + GOOGLE SHEETS NOTES AND EXPANSIONS


Now that you have the basic connection in place, you can consult the documentation for the full list of API endpoints. Or, if you just want to jump in, try entering the following URLs (one at a time):
https://api.constantcontact.com/v2/contacts?api_key=YOUR_API_KEY
https://api.constantcontact.com/v2/lists?api_key=YOUR_API_KEY
https://api.constantcontact.com/v2/emailmarketing/campaigns?api_key=YOUR_API_KEY

You can also play around with sample calls in the API Tester tool at https://constantcontact.mashery.com/io-docs

Leave a Comment