# Error:400,{"reason":"Invalid client\_id or client\_secret","error":"invalid\_client"}

**URL:** <https://devforum.zoom.us/t/error-400-reason-invalid-client-id-or-client-secret-error-invalid-client/95197>\
**Category:** API and Webhooks\
**Created:** [September 15, 2023, 5:49pm UTC](https://devforum.zoom.us/t/error-400-reason-invalid-client-id-or-client-secret-error-invalid-client/95197 "2023-09-15T17:49:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![johny.achkar01](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@johny.achkar01](https://devforum.zoom.us/u/johny.achkar01)\
**Post date:** [September 15, 2023, 5:49pm UTC](https://devforum.zoom.us/t/error-400-reason-invalid-client-id-or-client-secret-error-invalid-client/95197/1 "2023-09-15T17:49:31Z")

</div>

i created a new app for Oauth and i added properly the client ID and client secret but i am still getting this error.  
i am using python flask and this is my code, any help would be appreciated  
@app.route(‘/create\_meeting’, methods=[‘GET’, ‘POST’])  
def create\_meeting():  
topic = “Create Meeting”  
patient\_name = session.get(‘pt\_name\_booked’)  
doctor\_email = session.get(‘doc\_email’)  
slot\_duration = session.get(‘slot\_duration’)  
start\_time = session.get(‘start\_time’)  
current\_timestamp = round(time.time())  
iat = current\_timestamp  
exp = iat + (60 \* 60 \* 2)  
authorization\_url = f"{AUTHORIZE\_URL}?response\_type=code&client\_id={CLIENT\_ID}&redirect\_uri={REDIRECT\_URI}"  
print(authorization\_url)  
return f"Click here to authorize Zoom "

@app.route(‘/oauth/callback’)  
def oauth\_callback():  
code = request.args.get(‘code’)  
credentials = f"{CLIENT\_ID}:{CLIENT\_SECRET}"  
base64\_credentials = base64.b64encode(credentials.encode()).decode()

```
headers={
    'Authorization':base64_credentials,
    'Content-Type': 'application/x-www-form-urlencoded'
}
payload={
    'code':code,
    'grant_type':'authorization_code',
    'redirect_uri':REDIRECT_URI,

}
response = requests.post(TOKEN_URL,headers=headers,data=payload)
if response.status_code==200:
    access_token = response.json().get('access_token')
    return f"Access token received:{access_token}"
else:
    return f"Error:{response.status_code},{response.text}"

```

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [September 18, 2023, 3:00pm UTC](https://devforum.zoom.us/t/error-400-reason-invalid-client-id-or-client-secret-error-invalid-client/95197/2 "2023-09-18T15:00:03Z")

</div>

HI @johny.achkar01  
Thanks for reaching out to us…  
Have you been able to troubleshoot this on your end?  
If not, can you please confirm that you are generating your access token correctly?

> **[OAuth for user authorized apps](https://developers.zoom.us/docs/integrations/oauth/#getting-an-access-token)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![johny.achkar01](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@johny.achkar01](https://devforum.zoom.us/u/johny.achkar01)\
**Post date:** [September 18, 2023, 7:34pm UTC](https://devforum.zoom.us/t/error-400-reason-invalid-client-id-or-client-secret-error-invalid-client/95197/3 "2023-09-18T19:34:57Z")

</div>

Hi Elisa , thank you for your reply. the above error is now solved but i have a question … i am a beginner and appreciate any help.  
when i submit a form from the client side along with the request for user authorization as an ajax request. the ajax , when delayed to get a response that include the zoom link does not work. what is the best way to schedule an appointment that shows the zoom link on a calendar.  
this is my ajax request but it does not work coz i have to wait for the authorization then the zoom link to send it to the client side appointment schedule.  
const saveButton = document.querySelector(“#save-button”);  
const hiddenInput = document.getElementById(“submit-input”)  
saveButton.addEventListener(“click”, function (event) {  
event.preventDefault();  
$.ajax({  
type: ‘POST’,  
url: ‘/book\_appointment’,  
data: $(‘#appointment-form’).serialize(),  
dataType: ‘json’,  
success: function (response) {  
console.log(response)  
var eventData = {  
id: response.gener\_id,  
title: ‘Booked Appointment’,  
start: response.start\_time,  
end: response.end\_time,  
extendedProps: {  
patientName: response.patient\_name,  
family: response.patient\_family\_name,  
zoom\_link:response.zoom\_link

```
                    }
                };

```

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [September 20, 2023, 2:21pm UTC](https://devforum.zoom.us/t/error-400-reason-invalid-client-id-or-client-secret-error-invalid-client/95197/4 "2023-09-20T14:21:21Z")

</div>

Hi @johny.achkar01  
I do not think you can make API requests on the client side, this should be managed in your backend.

---

<div class="post-metadata">

**Author:** ![arsalan.9798](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/arsalan.9798/32/51073_2.png) [@arsalan.9798](https://devforum.zoom.us/u/arsalan.9798)\
**Post date:** [October 21, 2023, 10:54am UTC](https://devforum.zoom.us/t/error-400-reason-invalid-client-id-or-client-secret-error-invalid-client/95197/5 "2023-10-21T10:54:49Z")

</div>

Hi Johny can you tell me the solution for the encoding you did in python

---

<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:** [October 31, 2023, 8:51pm UTC](https://devforum.zoom.us/t/error-400-reason-invalid-client-id-or-client-secret-error-invalid-client/95197/6 "2023-10-31T20:51:34Z")

</div>

Closed on October 31, 2023, 8:51pm UTC

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