# OAuth 2.0: {"reason":"Invalid Grant","error":"invalid\_grant"}

**URL:** <https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409>\
**Category:** API and Webhooks\
**Created:** [April 26, 2023, 9:30am UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409 "2023-04-26T09:30:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavlokr](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pavlokr/32/47198_2.png) [@pavlokr](https://devforum.zoom.us/u/pavlokr)\
**Post date:** [April 26, 2023, 9:30am UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/1 "2023-04-26T09:30:59Z")

</div>

I’m trying to integrate my app but I keep getting this error

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

```

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

My code listing:

```auto
        $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);

```

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 26, 2023, 9:37am UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/2 "2023-04-26T09:37:43Z")

</div>

@pavlokr Hope you will be fine.

Here are the sessions regarding OAuth 👇

→ [Zoom Integration OAuth App Part 1](https://youtu.be/LY7jXL9FSqA)  
→ [Zoom Integration OAuth App Part 2](https://youtu.be/ytkNxMyZ8_E)

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

→ [Create Zoom Meeting - (REST API)](https://youtu.be/4wPWajTEjxE)  
→ [How to Create password less Zoom Meeting -(REST API)](https://youtu.be/T6DGDgwetr8)  
→ [How to Enable Zoom Meeting Registration - (REST API)](https://youtu.be/yYu2NcMx5aA)

Here are the sessions regarding WebSDK Integrations

- [Zoom Meeting SDK Integration with VueJS](https://youtu.be/CMpe56VoTTo)
- [Zoom Meeting SDK Integration with ReactJS](https://youtu.be/4BgkLvH7T0Y)
- [Zoom Meeting SDK Integration with AngularJS](https://youtu.be/utXjISjjHOY)

---

<div class="post-metadata">

**Author:** ![pavlokr](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pavlokr/32/47198_2.png) [@pavlokr](https://devforum.zoom.us/u/pavlokr)\
**Post date:** [April 26, 2023, 12:11pm UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/3 "2023-04-26T12:11:44Z")

</div>

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"}`

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 26, 2023, 12:17pm UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/4 "2023-04-26T12:17:28Z")

</div>

@pavlokr in redirect are you getting an authorization code?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 26, 2023, 12:19pm UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/5 "2023-04-26T12:19:25Z")

</div>

> [@pavlokr](#):
>
> but your video instructions is useless for me

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

---

<div class="post-metadata">

**Author:** ![pavlokr](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pavlokr/32/47198_2.png) [@pavlokr](https://devforum.zoom.us/u/pavlokr)\
**Post date:** [April 26, 2023, 12:33pm UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/6 "2023-04-26T12:33:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![arsalan.9798](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/arsalan.9798/32/51073_2.png) [@arsalan.9798](https://devforum.zoom.us/u/arsalan.9798)\
**Post date:** [August 16, 2023, 5:38pm UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/7 "2023-08-16T17:38:35Z")

</div>

[http://localhost:8000/zoom/oauth/callback](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”}

---

<div class="post-metadata">

**Author:** ![malinda.p](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@malinda.p](https://devforum.zoom.us/u/malinda.p)\
**Post date:** [September 15, 2023, 3:56pm UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/8 "2023-09-15T15:56:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [September 18, 2024, 7:32am UTC](https://devforum.zoom.us/t/oauth-2-0-reason-invalid-grant-error-invalid-grant/87409/9 "2024-09-18T07:32:27Z")

</div>

Closed on September 18, 2024, 7:32am UTC

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
