title: Unable to get access token from json rsponse
body: <p>I am working on implementation of strava in my website. I am new to JavaScript and I am not understanding whether I am doing it correctly or not. My problem is  I am unable to get access token from JSON response. I don't know why. Please Help me.</p>
  <p>the resonse what I am getting</p>
  <p><a href="https://i.stack.imgur.com/lR4u3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lR4u3.png" alt="enter image description here" /></a></p>
  <p>code</p>
  <pre><code>&lt;script&gt;
      const auth_link = &quot;https://www.strava.com/oauth/token&quot;
  function getActivites(res){
  console.log('response2',res.json());
      const activities_link = `https://www.strava.com/api/v3/athlete/activities?access_token=${res.access_token}`
      fetch(activities_link)
          .then((res) =&gt; console.log(res.json()))
  }
  function reAuthorize(){
      fetch(auth_link,{
          method: 'post',
          headers: {
              'Accept': 'application/json, text/plain, */*',
              'Content-Type': 'application/json'
          },
          body: JSON.stringify({
              client_id: 'xxxx',
              client_secret: 'xxxxx',
              refresh_token: 'xxxxx',
              grant_type: 'refresh_token'
          })
      })
      .then(res =&gt; {
          var response = res.json();
          var access_token = response.access_token;
          console.log('response',access_token)
         // getActivites(res)
          })
  }
  reAuthorize()
  
  &lt;/script&gt;
  </code></pre>
  <p>I am getting access token as <code>undefined</code></p>