i need bearer access token.
and my php curl code.
$client_id = 'my_id';
$client_secret = 'my_secret_pwd_id';
$grant_type = 'refresh_token';
$scope = '';
$URL = 'https://id.twitch.tv/oauth2/token';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'client_id' => $client_id,
'client_secret' => $client_secret,
//'grant_type' => $grant_type,
//'scope' => $scope,
]));
$output = curl_exec($ch);
curl_close($ch);
$oauth = json_decode($output, true);
i don’t understand grant_type.
scope is optional.