Getting a token: 400 Bad Request

Using the brute-force method, I found a working option:

$urlp=“https://id.twitch.tv/oauth2/token?client_id=".$this->APIkey."&client_secret=".$this->APIkeySecr."&grant_type=client_credentials”;

	$fields = array(
		'__V'      => '1'
	);
	$fields_string = http_build_query($fields);

	$ch = curl_init();
	curl_setopt($ch,CURLOPT_URL, $urlp);
	curl_setopt($ch,CURLOPT_POST, true);
	curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
	curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); 
	$data = curl_exec($ch);

Thanks to all!