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.