Enter the Share Your Success Sweepstakes 2024 For the Chance to Win Great Prizes!

Getting null response on getAccessToken

BenM2
Rookie
0 Votes

Hi

Try to create an API program to access contacts on our constant contact account.
Following the OAuth2.0 Server Flow as described on your website.
First, I created the authorization request url, then retrieved the authorization code from it.
Then I passed the code to 'getAccessToken' function to get an access token. It returned null.

Not sure why I am getting null, could you help me?

 

$code = $request->input('code');
$ccAuthorizationURL= $this->getAccessToken($code);
dump($ccAuthorizationURL);

 

curl resource @604   url: "https://idfed.constantcontact.com/as/token.oauth2?code=1wwtp21NvvvvTMAkCvh_lVgDJ&redirect_uri=http://localhost:8080/admin/constantcontact/rljccco"
  content_type: null
  http_code: 0
  header_size: 0
  request_size: 0
  filetime: -1
  ssl_verify_result: 0
  redirect_count: 0
  total_time: 0.0
  namelookup_time: 0.0
  connect_time: 0.0
  pretransfer_time: 0.0
  size_upload: 0.0
  size_download: 0.0
  speed_download: 0.0
  speed_upload: 0.0
  download_content_length: -1.0
  upload_content_length: -1.0
  starttransfer_time: 0.0
  redirect_time: 0.0
  redirect_url: ""
  primary_ip: ""
  certinfo: []
  primary_port: 0
  local_ip: ""
  local_port: 0
  http_version: 0
  protocol: 0
  ssl_verifyresult: 0
  scheme: ""
  appconnect_time_us: 0
  connect_time_us: 0
  namelookup_time_us: 0
  pretransfer_time_us: 0
  redirect_time_us: 0
  starttransfer_time_us: 0
  total_time_us: 0
}

 

1 REPLY 1
Courtney_E
Moderator
0 Votes

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

 

It looks like we'll some additional information in order to assist with troubleshooting. If you could please provide us with your full URL request, the API key you are using, as well as any timestamps you have available, we'll be able to better assist in pinpointing the cause of the null response. Please provide this information securely by reaching out to us via email at webservices@constantcontact.com, and reference case number 28009990. We look forward to assisting you!


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