# Generate Authorization code and token c# code

**URL:** <https://devforum.zoom.us/t/generate-authorization-code-and-token-c-code/39197>\
**Category:** API and Webhooks\
**Created:** [December 26, 2020, 9:19am UTC](https://devforum.zoom.us/t/generate-authorization-code-and-token-c-code/39197 "2020-12-26T09:19:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [December 28, 2020, 8:24pm UTC](https://devforum.zoom.us/t/generate-authorization-code-and-token-c-code/39197/2 "2020-12-28T20:24:27Z")

</div>

Hi @mnf,

Thanks for reaching out about this. Have you had a chance to look over our OAuth Guide?

> **[OAuth 2.0 - Authorization - Documentation](https://marketplace.zoom.us/docs/guides/auth/oauth)**
>
> OAuth with Zoom
> 
> The Zoom API uses OAuth 2.0 to authenticate and authorize users to make requests. To setup access credentials and request scopes for yo...

The first step, if you haven’t already, is to [create an OAuth App](https://marketplace.zoom.us/docs/guides/build/oauth-app) to generate your Client ID and Secret. From there, you will then need to follow steps 1 and 2 in our guide: retrieving the `code` from your redirect URL after the user installs the app, and then using that code in step 2 to fetch an access token.

Your second request (after you retrieve the code), should look something like this:

```auto
var client = new RestClient("https://zoom.us/oauth/token?grant_type=authorization_code&code={code}&redirect_uri=https://zoom.us");

client.Timeout = -1;

var request = new RestRequest(Method.POST);

request.AddHeader("Authorization", "Basic <base64encoded_clientId_clientSecret>");

IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);

```

Let me know if this helps,  
Will

---

_[View the full topic](https://devforum.zoom.us/t/generate-authorization-code-and-token-c-code/39197)._
