Showing results for 
Search instead for 
Did you mean: 

v3 curl example not working

Occasional Visitor

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" "{my-client-id-here}&scope=contact_data&re..."






So now what?





Re: v3 curl example not working



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