title: How to get access token from Zoom by sending a request?
body: <p>I have been working on integrating Zoom video conferencing API in my web application. By using OAuth and authorizing my application to Zoom, I have got an authorization code which can be used to get access token from Zoom to make subsequent API requests. I am sending a node request to <a href="https://zoom.us/oauth/token" rel="nofollow noreferrer">https://zoom.us/oauth/token</a> endpoint according to <a href="https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom#me-context" rel="nofollow noreferrer">this documentation</a> for getting access token.</p>
  <p>I don't have any idea why they are using <code>zoomcallback</code> as their endpoint. Below is the code to send a request to get access token:</p>
  <pre><code>router.get('/zoomcallback', function(req, res) {
  
      const zoomtokenep = &quot;https://zoom.us/oauth/token&quot;;
      const myappredirect = &quot;https://myapp.io/zoomcallback&quot;;
  
      if (req.query.code) {
          var auth = &quot;Basic &quot; + new Buffer(zoomclientid + ':' +
              zoomclientsec).toString('base64');
          var url = zoomtokenep + '?grant_type=authorization_code&amp;code=' +
              req.query.code + '&amp;redirect_uri=' + myappredirect;
          request.post({
              url: url,
              headers: {
                  &quot;Authorization&quot;: auth
              }
          }, function(error, response, body) {
              if (error) {
                  console.log(&quot;Error when getting Zoom token = &quot; + error);
                  return;
              }
              body = JSON.parse(body);
              if (body.access_token) {
                  accessToken = body.access_token;
                  refreshToken = body.refresh_token;
                  // Process and securely store these tokens
              } else {
                  console.log(&quot;FATAL - could not get zoom token&quot;);
              }
              return;
          });
  
      } else {
          console.log(&quot;Missing code from Zoom&quot;);
      }
      });
  </code></pre>
  <p>This is the successful response against this request:</p>
  <pre><code>{
    &quot;access_token&quot;: &quot;5kwaMOrdEFWx1jYVK8qg80cImPYBA83Zff&quot;,
    &quot;token_type&quot;: &quot;bearer&quot;,
    &quot;refresh_token&quot;: &quot;Ggf2816C5ANa6XVplzO8vwE6IRIXtjvE&quot;,
    &quot;expires_in&quot;: 3599,
    &quot;scope&quot;: &quot;meeting:write user:read recording:write webinar:write&quot;
  }
  </code></pre>