Hello,
I've been browsing the forum for an answer but unfortunately didn't find a fix to my issue yet.
I'm using PHP Laravel framework, trying to get my access token, this is what I keep getting:
+"error": "unsupported_grant_type"
+"error_description": "The value specified for the grant_type parameter '' was not valid."
After trying to use my usual way (Guzzle) with no success,
I copied the code from the tutorial, Here's the code I'm using right now:
$postRequest = array(
'code: '.$code,
'grant_type: authorization_code',
'redirect_uri: https://nmf.nmf/blackbaud'
);
$cURLConnection = curl_init('https://oauth2.sky.blackbaud.com/token');
curl_setopt($cURLConnection, CURLOPT_POST, true);
curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, array(
"Content-type: application/x-www-form-urlencoded",
"Authorization: Basic " . base64_encode($this->client_id . ":" . $this->client_secret)
));
curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $postRequest);
$apiResponse = curl_exec($cURLConnection);
curl_close($cURLConnection);
Please help! I really have no idea what is going on.
Thank you.