title: notion-api invalid_client oauth integration
body: <p>I am creating a notion API integration with OAuth authentication.
  I keep getting an <strong>invalid_client</strong> error when the user clicks allow access button and OAuth follow hits my callback URL. Also, <strong>auth_token</strong> is created in base64 format via <strong>client_id:client_secret</strong> which is provided in the integration console. <strong>Code</strong> is returned as query param when the OAuth process hits my callback URL.</p>
  <p>What am I missing?</p>
  <pre class="lang-js prettyprint-override"><code>const code = req.query.code;
  
  const auth_token = Buffer.from(
      &quot;my_oauth_client_id:my_oauth_client_secret&quot; // provided in integration panel
  ).toString(&quot;base64&quot;);
  
  await axios
      .post(
          &quot;https://api.notion.com/v1/oauth/token&quot;, {
              code,
              grant_type: &quot;authorization_code&quot;,
              redirect_uri: &quot;https://notion-fastlane-web-2hfaoof9v-oak93.vercel.app/api/notion/oauth/callback&quot;,
          }, {
              headers: {
                  &quot;Content-Type&quot;: &quot;application/json&quot;,
                  Authorization: `Basic ${auth_token}`,
              },
          }
      )
      .then(() =&gt; res.status(200).send(&quot;OK&quot;))
      .catch((error) =&gt; {
          res.status(error.response.status).send(error.response.data);
      });
  };
  </code></pre>