# Getting "Invalid client\_id or client\_secret" error while requesting oauth token

**URL:** <https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382>\
**Category:** API and Webhooks\
**Created:** [October 6, 2020, 9:57pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382 "2020-10-06T21:57:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![julie1](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@julie1](https://devforum.zoom.us/u/julie1)\
**Post date:** [October 6, 2020, 9:57pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/1 "2020-10-06T21:57:37Z")

</div>

**Description**  
I receive an error when calling `https://zoom.us/oauth/token`.

**Error**  
{  
“reason” =\> “Invalid client\_id or client\_secret”,  
“error” =\> “invalid\_client”  
}

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
OAuth

**Which Endpoint/s?**  
`https://zoom.us/oauth/token`

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. Following “OAuth with Zoom” guide on [https://marketplace.zoom.us/docs/guides/auth/oauth](https://marketplace.zoom.us/docs/guides/auth/oauth), I get past step 1 (Request User Authorization) and am on step 2 (Request Access Token).
2. When I call `https://zoom.us/oauth/token` with the specified query in the docs, I get the error as copy-pasted in the Error section.

**Screenshots (If applicable)**  
This is my app: (I don’t see test vs production details? This is the only section I see)

 ![Screen Shot 2020-10-06 at 2.49.42 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/d/c/dc756ac810a929b2a53edef7a2161f4990a5990f.png)

**Additional context**  
This is my code in Ruby:  
I am using HTTParty here, but I get the same error in other ways to make the same POST call.

```auto
authorization_code = params[:code]

uri = 'https://zoom.us/oauth/token?'\
  "grant_type=authorization_code&code=#{authorization_code}&"\
  "redirect_uri=#{ENV['ZOOM_REDIRECT_URL']}"

auth_header = Base64.strict_encode64("Client_ID:#{ENV['ZOOM_CLIENT_SECRET']}")

response = HTTParty.post(
  uri,
  headers: {
    'Authorization' => "Basic #{auth_header}"
  }
).parsed_response

```

“auth\_header” is a string that looks like this: `Q2xpZW50X0lEOmdqa3hkMmUwSUVkQzBXXXXXXXXXXXXXXXX`

Is there a place where we can view the call to Zoom and a detailed response for debugging?

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [October 6, 2020, 9:57pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/2 "2020-10-06T21:57:42Z")

</div>

Hey @julie1

Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question. 🙂

Checkout this related thread that may have the answer you are looking for:

> [@"Invalid client\_id or client\_secret"](https://devforum.zoom.us/t/-/5252):
>
> [https://zoom.us/oauth/token?grant\_type=authorization\_code&code=](https://zoom.us/oauth/token?grant_type=authorization_code&code=){my code}&redirection\_uri={my callback URL} Making a POST Request to the above URL shows { "reason": "Invalid client\_id or client\_secret", "error": "invalid\_client" } I’m not quite sure what the issue is. I had copy pasted the correct client ID before generating the code.

If this thread did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.

Thanks,  
DeveloperBot

---

<div class="post-metadata">

**Author:** ![julie1](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@julie1](https://devforum.zoom.us/u/julie1)\
**Post date:** [October 7, 2020, 8:46pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/3 "2020-10-07T20:46:16Z")

</div>

> [@julie1](#):
>
> `Base64.strict_encode64("Client_ID:#{ENV['ZOOM_CLIENT_SECRET']}")`

I found my mistake. The above should have been `Base64.strict_encode64("#{EMV['ZOOM_CLIENT_ID']}:#{ENV['ZOOM_CLIENT_SECRET']}")` and not the hardcoded “CLIENT\_ID”.

Still I have a few questions remaining:

- Is there a place where we can view the call to Zoom and a detailed response for debugging?
- In my app settings, I only see one set of credentials instead of one for testing and another for production. Is this intentional?

Thank you.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 8, 2020, 6:58pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/4 "2020-10-08T18:58:52Z")

</div>

Hey @julie1,

I’m glad you figured it out! Happy to answer your other questions.

> Is there a place where we can view the call to Zoom and a detailed response for debugging?

Yes, you can view the logs for recent API requests in your Marketplace account, on the left hand side:  
[https://marketplace.zoom.us/user/logs](https://marketplace.zoom.us/user/logs)

> In my app settings, I only see one set of credentials instead of one for testing and another for production. Is this intentional?

Is your app intended to be published? If you don’t mark your app as “intend to publish: yes” when you create it, you will only see one set of credentials, which is expected.

Let me know if this helps!

Best,  
Will

---

<div class="post-metadata">

**Author:** ![julie1](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@julie1](https://devforum.zoom.us/u/julie1)\
**Post date:** [October 8, 2020, 7:22pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/5 "2020-10-08T19:22:05Z")

</div>

Hi @will.zoom, thanks for your reply.

> Yes, you can view the logs for recent API requests in your Marketplace account, on the left hand side:

Unfortunately I don’t see the relevant link on the left hand side, can you elaborate? On `https://marketplace.zoom.us/` I only see links related to the marketplace itself, and in my app details page I don’t see any link to view logs:

 ![Screen Shot 2020-10-08 at 12.19.03 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/2/e/2e462368eaa22860bb237de84c816e367f2a428f.png)

> Is your app intended to be published? If you don’t mark your app as “intend to publish: yes” when you create it, you will only see one set of credentials, which is expected.

This makes sense, thanks.

Another question I have is: is it possible to manually trigger webhook events for development and testing purposes?

Thanks.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 9, 2020, 5:14pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/6 "2020-10-09T17:14:33Z")

</div>

Hey @julie1,

In regards to viewing call logs, do you have admin or marketplace privileges for your account? This is likely why you’re not seeing this. You can request these from your Account Administrator.

In terms of testing webhooks, you’ll need to actually complete an action in Zoom for this to be triggered (i.e., start a meeting, let a recording complete, etc.). We don’t have a test trigger at this time, though this is a great suggestion!

Let me know about the first question when you have a chance. 🙂

Best,  
Will

---

<div class="post-metadata">

**Author:** ![julie1](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@julie1](https://devforum.zoom.us/u/julie1)\
**Post date:** [October 9, 2020, 5:26pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/7 "2020-10-09T17:26:12Z")

</div>

Hi @will.zoom, yes I have made many API requests using my app credentials.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 9, 2020, 5:26pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/8 "2020-10-09T17:26:41Z")

</div>

Hey @julie1,

In regards to viewing call logs, do you have admin or marketplace privileges for your account? This is likely why you’re not seeing this. You can request these from your Account Administrator.

Best,  
Will

---

<div class="post-metadata">

**Author:** ![julie1](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@julie1](https://devforum.zoom.us/u/julie1)\
**Post date:** [October 9, 2020, 7:35pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/9 "2020-10-09T19:35:22Z")

</div>

Thanks @will.zoom, becoming an admin did the trick.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [October 12, 2020, 5:34pm UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/10 "2020-10-12T17:34:30Z")

</div>

Hey @julie1,

I’m glad that resolved the issue. 🙂

Best,  
Will

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [November 12, 2020, 3:34am UTC](https://devforum.zoom.us/t/getting-invalid-client-id-or-client-secret-error-while-requesting-oauth-token/32382/11 "2020-11-12T03:34:37Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
