Hi
When trying to update the access token, the following response is returned from the API.
-
{“status”:“BAD_REFRESH_TOKEN”,“message”:“missing or invalid refresh token”,“correlationId”:“xxxx”,“requestId”:“xxxxx”}
-
- Why does this problem happen?
-
My PHP code
$url = "https://api.hubapi.com/oauth/v1/token";
$argary = array(
'grant_type' => 'refresh_token',
'client_id' => 'XXXXXXXX',
'client_secret' => 'XXXXXXXX',
'redirect_uri' => 'https://XXXXX/OAuth/auth-callback',
'refresh_token'=> '--My first refresh token--'
);
$query_string = http_build_query($argary, "", "&");
$options = array (
'http' => array (
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded;charset=utf-8',
'content' => $query_string,
'ignore_errors' => true,
'protocol_version' => '1.1'
),
'ssl' => array (
//'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false
)
);
$contents = @file_get_contents($url, false, stream_context_create($options));
echo $contents;
exit();
-
- (I’m sorry, I am not so good at English.)