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

HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)

user544507
Rookie
0 Votes

I am trying to refresh the access token using API with PHP CURL before it was working fine, but now it is throwing this error message:

 

HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)

This is the code:

 

$ch = curl_init();

$base = 'https://authz.constantcontact.com/oauth2/default/v1/token';

$url = $base . '?refresh_token=' . $refreshToken . '&grant_type=refresh_token';
curl_setopt($ch, CURLOPT_URL, $url);

$auth = $clientId . ':' . $clientSecret;

$credentials = base64_encode($auth);

$authorization = 'Authorization: Basic ' . $credentials;
curl_setopt($ch, CURLOPT_HTTPHEADER, array($authorization, 'Content-Type: application/x-www-form-urlencoded'));

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
curl_close($ch);
return $result;

 

 Please guide how to fix this.

1 REPLY 1
John__B
Employee
0 Votes

Hello user544507,

 

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.

 

Upon doing some research on the error you encountered, I found that this can occur as a result of an update to the cURL version that your application is using, or with an HTTP configuration issue on the server your application is running on.

 

While our expertise is with our API itself as opposed to its implementation within any particular programming language, we are happy to answer any questions pertaining to Constant Contact’s API endpoints, functionality, and documentation.

 

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

 

Regards,


John B.
API Support Specialist
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