title: Node JS: TypeError: Cannot destructure property `access_token` of 'undefined' or 'null'
body: <p>I'm currently fetching a token from Zoom Api, which works fine. The problem lies after that when i'm trying to destructure the property so I can get the access_token.</p>
  <pre><code> var username = &quot;client id&quot;;
    var password = &quot;client password&quot;;
  
  var options = {
    method: 'POST',
    url: 'https://zoom.us/oauth/token?grant_type=client_credentials',
    headers: {
      /**The credential below is a sample base64 encoded credential. Replace it with &quot;Authorization: 'Basic ' + Buffer.from(your_app_client_id + ':' + your_app_client_secret).toString('base64')&quot;
      **/
     Authorization: 'Basic ' + Buffer.from(username + ':' + password).toString('base64'),
      &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot;
      }
    };
  
  
  const data = {
   &quot;topic&quot;: &quot;Demo Meeting&quot;,
               &quot;type&quot;: 2,
               &quot;start_time&quot;: &quot;2020-05-05 12:00:00&quot;,
               &quot;password&quot;: &quot;Hey123&quot;,
               &quot;agenda&quot;: &quot;This is the meeting description&quot;,
               &quot;settings&quot;: {
               &quot;host_video&quot;: false,
               &quot;participant_video&quot;: false,
               &quot;join_before_host&quot;: false,
               &quot;mute_upon_entry&quot;: true,
               &quot;use_pmi&quot;: false,
               &quot;approval_type&quot;: 0
               }
  };
  
  
  
  function getResponse() {
    return rp(options, function(error, response, body) {
     if (error) throw new Error(error)   
  
      const { access_token } = response.data;
      console.log(access_token)
      
    }).then(function (req) {
        //logic for your response
        console.log(&quot;inside response&quot;, req);
      
     return fetch(&quot;https://api.zoom.us/v2/users/me/meetings&quot;, {
        method: &quot;POST&quot;,
        headers: {
          Authorization: `Bearer ${req}`,
          &quot;Content-Type&quot;: &quot;application/json&quot;
        },
        body: JSON.stringify(data)
    });
      })
      .catch(function (err) {
          // API call failed...
          console.log('API call failed, reason ', err);
      });
  }
  </code></pre>
  <p>When i'm runnin the code, I get the following error: TypeError: Cannot destructure property <code>access_token</code> of 'undefined' or 'null'.</p>
  <p>Any reason why this happens?</p>