# The error in request of access token (PHP-Laravel - \> OAuth)

**URL:** <https://devforum.zoom.us/t/the-error-in-request-of-access-token-php-laravel-oauth/59265>\
**Category:** API and Webhooks\
**Created:** [October 23, 2021, 10:48am UTC](https://devforum.zoom.us/t/the-error-in-request-of-access-token-php-laravel-oauth/59265 "2021-10-23T10:48:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![titorovd](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/titorovd/32/31540_2.png) [@titorovd](https://devforum.zoom.us/u/titorovd)\
**Post date:** [October 23, 2021, 10:48am UTC](https://devforum.zoom.us/t/the-error-in-request-of-access-token-php-laravel-oauth/59265/1 "2021-10-23T10:48:55Z")

</div>

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/](https://artisansweb.net/how-to-create-a-meeting-on-zoom-using-zoom-api-and-php/)

This is my function

```auto
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?

---

<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:** [October 26, 2021, 10:31pm UTC](https://devforum.zoom.us/t/the-error-in-request-of-access-token-php-laravel-oauth/59265/2 "2021-10-26T22:31:37Z")

</div>

Hi @titorovd

Thanks for reaching out to the Zoom Developer Forum, I am happy to help here!

Do you run into the same error when you test this request in Postman or using cURL?

Thanks,  
Elisa

---

<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:** [November 26, 2021, 8:32am UTC](https://devforum.zoom.us/t/the-error-in-request-of-access-token-php-laravel-oauth/59265/3 "2021-11-26T08:32:33Z")

</div>

Closed on November 26, 2021, 8:32am UTC

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