Simple OATH2 C# code for console application login

SOLVED
Highlighted
Occasional Contributor

Simple OATH2 C# code for console application login

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

Accepted Solutions
Highlighted
Honored Contributor

Re: Simple OATH2 C# code for console application login

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
Highlighted
Occasional Contributor

Re: Simple OATH2 C# code for console application login

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

Highlighted
Honored Contributor

Re: Simple OATH2 C# code for console application login

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

Developer Portal

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

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured