We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

v3 curl example not working


v3 curl example not working

I'm stumped.  I set up a new trial account and attempted to use api V3. I want a server side way to add contacts from another system.  I make the curl request and it returns 302



curl -X GET -i -H "application/x-www-form-urlencoded" "https://api.cc.email/v3/idfed?response_type=code&client_id={my-client-id-here}&scope=contact_data&re..."






So now what?







It looks like you are trying to connect and/or set up OAuth. The authorization URL once visited should redirect you to a Constant Contact login page, so a 302 would be expected response, though it's designed for you to visit it in a web browser rather than using cURL to GET it. Here's the general process that OAuth would follow:

  • The Constant Contact account owner clicks on something in your app/page to connect it to Constant Contact (a link, button, etc.)
  • The link they click sends them in a new tab or window to your authorization URL.
  • The account owner is shown a Constant Contact login page and logs in
  • The account owner is asked to allow your app access and clicks "Allow"
  • Constant Contact directs the account owner back to your application (your redirect URI) and adds a query parameter to the URL with the authorization code.
  • Your application grabs this parameter and then makes a POST call to exchange the authorization code for an access token and refresh token

You then store these fields and use them when making API calls. If you are building this for only use by one Constant Contact account, you can manually authorize using your browser and a REST client. First, go to the authorization URL using a browser, follow the steps to allow access, manually copy the authorization code, and then use your REST client to make the POST call to exchange that code for a refresh and access token.


Please have a look and let me know if you have any questions!


David B.
Tier II API Support Engineer


I'm facing the same issue.  I have navigated to the authorization url through the browser, but it just redirects me to my redirection url and I am not getting redirected to constant Contact login page to allow access.  The redirection url I specified can handle post requests too.  Please let me know how can I get the authorization code response.



I would like to know what the authorization URL is you are using, and to try it out on my end here. For privacy, please email my team at webservices@constantcontact.com with the URL you are using.

David B.
Tier II API Support Engineer

Developer Portal

View API documentation, code samples, get your API key.

Visit Page