400 ERR_BAD_REQUEST while trying to get access token

Hi there, I am planning to create an SDK for our customers. We are a saas company and allowing users to create meeting, webnairs etc and let their users signup in their sites and with the help of web sdk, we will show the meeting in their own website instead in zoom’s website. I created an app in developer account for sdk. I used the client id and secrete id to generate code but i am not able to get the access key from the code. Here is my request…

const config = {
      method: "POST",
      url: "https://zoom.us/oauth/token",
      headers: {
        Host: "zoom.us",
        "Content-Type": "application/x-www-form-urlencoded",
        Authorization: "Basic" + Buffer.from(
            `CLINET_ID:SECRETE_ID`
          ).toString("base64"),
      },
      body: {
        code: code,
        grant_type: "authorization_code",
        redirect_uri: `${baseUrl}teacher/payment-gateways/zoom-oauth-callback`,
      },
    };
    try {
      const req = await axios(config);
      return req
    } catch (error) { 
        return error
    }

I am getting 400 bad request. Thank you.

Hi @sadek.hkm ,

Please try using our Postman workspace and seeing if you are successful. This can help isolate the issue: Postman

Methods to fix-

Check for Errors in the Address. First, you’ll want to check your URL for any errors.
Clear Your Browser’s Cache and Cookies.
Disable Browser Extensions.
Flush the DNS Cache.
Check the Uploaded File Size.
Troubleshoot Your Device and Internet Connection.

Regards,
Rachel Gomez

1 Like