Master email marketing fundamentals and transform your business. Join the Ready, Set, Send Challenge!

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.

0 REPLIES 0
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