I write integration between zoom and education servise. My service use Laravel. I use OAuth authentification in Zoom App
The reason of my code is: https://artisansweb.net/how-to-create-a-meeting-on-zoom-using-zoom-api-and-php/
This is my function
function zoom_callback( Request $request){
$client_id = $this->client_id;
$client_secret = $this->client_secret;
$redirect_uri = $this->redirect_uri;
$code = $request->code;
$response = Http::withHeaders([
'Authorization' => "Basic ". base64_encode($client_id.':'.$client_secret),
'Content-Type' => "application/x-www-form-urlencoded"
])->post('https://zoom.us/oauth/token', [
"grant_type" => "authorization_code",
"code" => $code,
"redirect_uri" => $redirect_uri
]);
dump($response);
$token = $response->getBody()->getContents();
dump($token);
}
Error
Where I send request I recieve error “{“reason”:“Missing grant type”,“error”:“invalid_request”}”
Can you help me where is the mistake?