// Identification du client avec HTTP Basic Authentication : $data = array( 'grant_type' => 'refresh_token', 'refresh_token' => $refresh_token, ); $h = curl_init($token_endpoint); curl_setopt($h, CURLOPT_RETURNTRANSFER, true); curl_setopt($h, CURLOPT_TIMEOUT, 10); curl_setopt($h, CURLOPT_POST, true); curl_setopt($h, CURLOPT_USERPWD, "{$client_id}:{$client_secret}"); curl_setopt($h, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($h, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_setopt($h, CURLOPT_POSTFIELDS, http_build_query($data)); $res = curl_exec($h); if ( is_array(json_decode($res, true) ) ) { curl_close($h); $res = json_decode($res, true); }