I am trying to get an access token via a php Curl request. From all the responses I'm seeing here as well as the API v3 documentation itself, you go to a url in your browser like:
This in turn redirects you to a constant contact login page. You log in and it redirects you to a page that has the access token in the url.
How do I retrieve the access token without having to manually go to the url and login via a browser? There has to be a way to get this. Other APIs do not make you use a browser. Given that you're using OAuth2, is it possible to use the public/private key combined with username/password (grant_type of password)?
Hello BethA83512,
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.
There is currently no way to bypass the initial Authorization Request screen, which can only be accessed/authorized via a browser window, but you should only need to authorize an account once.
After you complete the OAuth2 server flow for V3, Constant Contact returns an access token and refresh token. You can use access tokens to make requests using the V3 API, and you can use the refresh tokens to obtain new access tokens without any user input. This ensures that you only need to authenticate the account you’ll be connecting to once. After the initial authentication, you’ll just use the refresh token and access token to complete your future requests.
V3 API OAuth2.0 Server Flow
https://v3.developer.constantcontact.com/api_guide/server_flow.html
Tokens Overview
https://developer.constantcontact.com/api_guide/auth_overview.html#tokens
Please have a look and let us know if you have any other questions!
Constant contact seems to make a huge job of connecting their API to website-- I have just signed up to Constant contact and already thinking of ditching it. Other autoresponders just provide and API which you easily add to your website- and all is good to go
Hello user928830,
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.
Thanks for your reply! Your feedback and experience with this request is essential to improving our product, so thank you for reaching out to us regarding this matter.
We're currently making updates to our authentication system. This work would need to be completed prior to implementing additional authentication flows, however we are looking into them as future options. Some of the options currently under consideration include: Client Credentials flow, the Device Authorization flow, static refresh tokens, etc.
If you have a specific use case or auth type that you feel would better meet your needs, we’d love to hear from you. If possible, please include what specific solution(s) you’re looking for, whether your app would only access your own Constant Contact’s account data or if it would also be used by other accounts, etc. You can reply here, or contact us directly via email at webservices@constantcontact.com.
Regards,
Announcements
Join our list to be notified of new features and updates to our V3 API.
Sign Up