The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

OAuth 2.0 in v2 API .NET SDK

Occasional Contributor

OAuth 2.0 in v2 API .NET SDK

The ConstantContact class in the v2 .NET SDK appears to have 2 constructors:


public ConstantContact()
public ConstantContact(string username, string password, string APIKey, string redirectURL)

With the empty constructor fetching values from the config file. I guess that's useful for single-user environments, but those appKey names are pretty generic and could easily collide with existing values. I think it'd be better to use a custom ConfigurationSection to keep them instead. Then you could have something in the config file like:


<constantContact username="" password="" apiKey="" redirectUrl="" />

The other constructor asks for the username and password. Since OAuth 2.0 is designed so that the user provides their username and password directly to the provider (Constant Contact) and not to the implementator, I won't know the username and password (nor should I).


How can I instantiate a ConstantContact instance using an access token instead of username and password?


Re: OAuth 2.0 in v2 API .NET SDK

Hi Gordon,


I agree, we certainly should have included an option to include an access token instead of username/password.  I have forwarded your points onto the appropriate people.


Best Regards,

Shannon W.

API Support Specialist

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More