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.

Accessing Constant Contacts through Https

SureshBabuS
Participant

Accessing Constant Contacts through Https

Hi,

 

I want to access the Constant Contacts through Https. I refered the OAuth2.0 authentication mechanism referred in the below link :

 

http://community.constantcontact.com/t5/Documentation/Authentication-using-OAuth-2-0-new-October-201...

 

and implemented my URLs as below :

 

https://oauth2.constantcontact.com/oauth2/oauth/siteowner/authorize?response_type=code&client_id=<my_api_key>&redirect_uri='https://api.constantcontact.com/ws/customers/<myusername>/contacts'

 

and

 

https://oauth2.constantcontact.com/oauth2/oauth/token?grant_type=authorization_code&client_id=<my_api_key>&client_secret=<my_client_secret>&

 

along with a form variable var which contains the previous URL's response message.

 

but the response of the second URL is simply "internal exception". I am clueless on how to proceed. Can someone guide me on proper implementation of this.

 

Thanks and Regards,

Suresh

 

1 REPLY 1
DaveBerard
Moderator

The Redirect URL must be a URL that is on your server to handle the response we send back to you.  It looks like you're including the resource you're attempting to access, which is going to cause problems with the OAuth flow.  Basically, the simplified OAUth 2.0 flow must be this:

 

 

Constant Contact Server                                                        Developer Production Server

 

Process request                                              <-------------           Request OAuth Access

 

Send Verification Token to Redirect URL       -------------->          Receive Verification Token

 

Process request                                              <-------------           Request Access Token from Verification Token

 

Send Access Token to Redirect URL              -------------->         Receive Access Token

 

 

Once you receive the Access token, you can store that locally for all future OAuth 2.0 requests.  This, combined with your API key, Consumer Secret token and your username/request URL will allow you to access the API via HTTPS requests.   For more information on this flow, you should read up on the OAuth 2.0 spec and our implementation here: http://community.constantcontact.com/t5/Documentation/Authentication-using-OAuth-2-0-new-October-201...

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page