Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

How to generate authorization code by a program

user6241929
Rookie
0 Votes

Hello.

I have successfully generated the authorization url.

 
Using this I have to generate the authorization code programatically in PHP.
By simply the authorization url I will get the code fromhttp://localhost:8888/?code=lN1LhAHGX6oOSIKuty0RzWJnv5120O
as suggested  in the documentation. But I have to generate the authorization code programatically. Is there any solution?
1 REPLY 1
Courtney_E
Moderator
0 Votes

Hello user6241929,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

You will want to use the Redirect URL to send the authorization code from the Authorization Request URL back to your Application in order to exchange it for your initial token set.

 

Example Authorization Request URL
https://v3.developer.constantcontact.com/api_guide/scopes.html#example-authorization-request-url

 

Get the Token from the Redirect URL
https://v3.developer.constantcontact.com/api_guide/auth_overview.html#get-the-token-from-the-redirec...

 

There is no way to bypass the Authorization Request screen (which is only accessible via browser), but you should only need to authorize an account once. Once you go through the V3 API OAuth2.0 Server Flow in order to get an access token and refresh token for your key, you can use access tokens to make requests using the V3 API, and refresh tokens to obtain new access tokens without any user input. This ensures that your users only need to authenticate once.

 

Please have a look and let us know if you have any other questions!


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
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