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

http://localhost:8000/zoom/oauth/callback → after encoding → http%3A%2F%2F0.0.0.0%3A8000%2Fzoom%2Foauth%2Fcallback

this is my redirect uri, i am getting the access code by authorize , but when passing through oauth/token i am getting {“reason”:“Invalid Grant”,“error”:“invalid_grant”}

1 Like

I’m getting the same issue any update on this.

1 Like