# OAuth API call (Get authorization code) - Laravel

**URL:** <https://devforum.zoom.us/t/oauth-api-call-get-authorization-code-laravel/94420>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [September 4, 2023, 9:38am UTC](https://devforum.zoom.us/t/oauth-api-call-get-authorization-code-laravel/94420 "2023-09-04T09:38:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![epzoom](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@epzoom](https://devforum.zoom.us/u/epzoom)\
**Post date:** [September 4, 2023, 9:38am UTC](https://devforum.zoom.us/t/oauth-api-call-get-authorization-code-laravel/94420/1 "2023-09-04T09:38:45Z")

</div>

Hello,

I am trying to get an authorization code from within the Laravel-based app. I am getting “Bad Request - 400” error.

```auto
$response = $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" => $_GET['code'],
            "redirect_uri" => "https://app.app.com/oauth/success",
        ]);

dd($response->getBody()->getContents())

```

Response below:

```auto
"{"reason":"unsupported grant type","error":"unsupported_grant_type"}"

```

I also noticed that the error remains as is even if the client id and client secret are incorrect.

Can someone please point me in the direction of how to rectify this?

Thanks a lot for the help.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [September 8, 2023, 3:36pm UTC](https://devforum.zoom.us/t/oauth-api-call-get-authorization-code-laravel/94420/2 "2023-09-08T15:36:39Z")

</div>

Hi @epzoom  
Welcome to our community! I am happy to help here!  
make sure that you are grabbing the callback by Zoom

> **[OAuth for user authorized apps](https://developers.zoom.us/docs/integrations/oauth/#step-2-request-access-token)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<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 11, 2024, 7:13am UTC](https://devforum.zoom.us/t/oauth-api-call-get-authorization-code-laravel/94420/3 "2024-09-11T07:13:29Z")

</div>

Closed on September 11, 2024, 7:13am UTC

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