Get access token without navigating in a browser

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:

 

https://api.cc.email/v3/idfed?client_id=my_api_key&redirect_uri=https://localhost&response_type=token&scope=account_read

 

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)?

2 replies

Leaderboard