Simple OATH2 C# code for console application login

SOLVED
Go to solution
HeatherW14
Marketing Legend

Does anyone have some simple C# code to return the Access Token given the the Username, password and API Key?  I'm trying to build several C# console applications.

 

Thanks,

Tony

1 ACCEPTED SOLUTION
Elijah_G
Marketing Legend

Hi Tony,

 

You can simply use the API Key and Access Token that is generated through the MAshery I/O Docs. The OAuth flow is provided specifically for use with applications that want to connect with multiple Constant Contact accounts. If you are working to create console applications that would be expected to access multiple unique Constant Contact applications, you would likely need a database and a secondary application to handle the OAuth flow so that you can gather the Access Tokens for those accounts.

 

Also as a last note, I want to clarify that an API key is used to identify your application, and an Access Token identifies and authenticates a Constant Contact account. There should be 1 API key per unique application, and there can be any number of Access Tokens that involve a given API key.

 

If you have any questions about this, please let me know!

 

Best Regards,

Elijah G.
API Support Engineer

View solution in original post

2 REPLIES 2
HeatherW14
Marketing Legend
0 Votes

I guess I'm confused if I even need to authenticate this way.  Do I just use the API Key and Access Token?

Elijah_G
Marketing Legend

Hi Tony,

 

You can simply use the API Key and Access Token that is generated through the MAshery I/O Docs. The OAuth flow is provided specifically for use with applications that want to connect with multiple Constant Contact accounts. If you are working to create console applications that would be expected to access multiple unique Constant Contact applications, you would likely need a database and a secondary application to handle the OAuth flow so that you can gather the Access Tokens for those accounts.

 

Also as a last note, I want to clarify that an API key is used to identify your application, and an Access Token identifies and authenticates a Constant Contact account. There should be 1 API key per unique application, and there can be any number of Access Tokens that involve a given API key.

 

If you have any questions about this, please let me know!

 

Best Regards,

Elijah G.
API Support Engineer
Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up

Polls
How confident are you about the effectiveness of your current marketing strategy?

Top Choice: Not confident at all (61%)