OAuth 2.0: {"reason":"Invalid Grant","error":"invalid_grant"}

Iā€™m trying to integrate my app but I keep getting this error

{"reason":"Invalid Grant","error":"invalid_grant"}

I am using this instruction: https://developers.zoom.us/docs/integrations/oauth/#getting-an-access-token

My code listing:

        $url = 'https://zoom.us/oauth/token';

        $data = [
            'code'          => $code,
            "grant_type"    => "authorization_code",
            "redirect_uri"  => url('/zoom-home')
        ];

        $headers = [
            'Content-Type: application/x-www-form-urlencoded',
            'Authorization: Basic '.base64_encode(env('ZOOM_CLIENT_ID').":".env('ZOOM_CLIENT_SECRET'))
        ];

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $result = curl_exec ($ch);
        curl_close ($ch);

@pavlokr Hope you will be fine.

Here are the sessions regarding OAuth :point_down:

ā†’ Zoom Integration OAuth App Part 1
ā†’ Zoom Integration OAuth App Part 2

Here :point_down: are the sessions regarding how to schedule meetings using REST API

ā†’ Create Zoom Meeting - (REST API)
ā†’ How to Create password less Zoom Meeting -(REST API)
ā†’ How to Enable Zoom Meeting Registration - (REST API)

Here are the sessions regarding WebSDK Integrations

Thank you, but your video instructions is useless for me.
I made everything like you, but continue receiving an error:
{"reason":"Invalid Grant","error":"invalid_grant"}

@pavlokr in redirect are you getting an authorization code?

If you follow correctly then you will successfully get an access token.

Thank you. I found my mistake
redirect_uri should be the same for https://zoom.us/oauth/authorize and https://zoom.us/oauth/token endpoints

2 Likes