"client_credentials", "client_id" => "myawesomeapp", "client_secret" => "abc123", "scope" => "basic email" ]; $data = http_build_query($data); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/x-www-form-urlencoded', 'Accept: 1.0' ]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $result = curl_exec($ch); if ($result === false) { echo 'curlError: ' . curl_error($ch); } else { echo $result; } curl_close($ch); } curl_post();