.Net Core 3.1 V3 API Example for internal service

We have an internal .Net Framework service using v2 API that has one role:  Allow multiple public-facing sites to add email addresses to our different mailing lists. This internal service manages all the authentication with CTCT for the public-facing sites. The task at hand is to upgrade the service to .Net Core 3.1.  While not a requirement, it seems logical to upgrade from v2 API to v3 API. 

 

Q1: Considering the simplicity of the service, is there any compelling reason to upgrade to v3?

 

Q2: Is this interpretation of reading the OAuth 2.0 Server Flow correct?

 

Considering this service is used by only our public-facing web sites, the process of getting the Authorization Code is regarding our one account with CTCT getting access to CTCT.  Because of this, it should be transparent to the public-facing web sites.

Based on that being a correct understanding, the following code has been modifying from code examples in the Beginner C# V3 API Example post and returns an error of: 

 

"error_key": "not_found",
"error_message": "The requested resource was not found."

 

 

 

var baseUrl =
    "https://api.cc.email/v3/idfed?client_id=" + apikey + "&redirect_uri=https%3A%2F%2Flocalhost%3A5000&response_type=code&grant_type=authorization_code";

var client = new RestClient(baseUrl);
var request = new RestRequest(Method.POST);

IRestResponse response = client.Execute(request);

 

 

From the Beginner C# V3 API Example support said this:  

Our V3 API is only able to be used with OAuth so there is no way to bypass the initial connection. However, once you have connected a Constant Contact account and received the initial access token and refresh token, you would use the refresh flow to exchange the refresh token for a new access token and refresh token without having to have the account owner log in again.

 

Q3:  Is there an example out there of how the service can acquire the initial access token?

1 reply

Quick Links

Leaderboard