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.
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,
Announcements
Join our list to be notified of new features and updates to our V3 API.
Sign Up