# Code 124 - Requests failing despite 200 response for access token

**URL:** <https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [November 4, 2022, 3:30pm UTC](https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312 "2022-11-04T15:30:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom\_bebraven](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tom_bebraven/32/42705_2.png) [@tom\_bebraven](https://devforum.zoom.us/u/tom_bebraven)\
**Post date:** [November 4, 2022, 3:30pm UTC](https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312/1 "2022-11-04T15:30:18Z")

</div>

**API Endpoint(s) and/or Zoom API Event(s)**  
POST [https://api.zoom.us/v2/meetings/:id/registrants](https://api.zoom.us/v2/meetings/:id/registrants), { email, first\_name, last\_name }

**Description**  
We made changes to our logic that determines when to send requests to the Zoom API. We did not change anything related to our Zoom client, or authentication.

For each request we send to the Zoom API, we first request a new token, then send our request using that token. The authentication request succeeded, yet our request to the registrant endpoint got 401 Unauthorized with an error code of 124.

This support article recommends submitting a Support request. (The Support ticket system is no longer in operation, which I only learned after writing up a full ticket.)

Unfortunately, we do not have an active staging environment, and these errors led to downstream data issues in our system, so I’m very wary of merging in the faulty code until we have a better idea of what caused these errors.

Thank you in advance for any help you can offer!

**Error?**  
Response body: { “code”:124, “message”: “Invalid access token.” }

**How To Reproduce**

1. Request URL : [https://api.zoom.us/v2/meetings/81610318742/registrants](https://api.zoom.us/v2/meetings/81610318742/registrants)  
Headers: {  
“Accept”:“application/json”,"  
Authorization":“[FILTERED]”,  
“Content-Length”:“88”,  
“Content-Type”:“application/json”,  
“User-Agent”:“rest-client/2.1.0 (linux x86\_64) ruby/3.1.2p20”  
}  
Body not logged. Sorry!

2. _Authentication method_: OAuth

3. Response code: 401 Unauthorized  
Response body: { “code”:124, “message”: “Invalid access token.” }  
Timestamp: 2022-10-31 T13:52:51 +00:00

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [November 4, 2022, 5:34pm UTC](https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312/2 "2022-11-04T17:34:46Z")

</div>

@tom_bebraven ,  
Thank you for posting a Zoom Developer Forum. Based on the error it looks like you are using are invalid access token when hitting the registration endpoint. Can you clarify if you were using a server to - server APP type? It seems like there you may be making a subsequent access token request, which may be invalidating the token making the request to the registrant endpoint.

---

<div class="post-metadata">

**Author:** ![tom\_bebraven](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tom_bebraven/32/42705_2.png) [@tom\_bebraven](https://devforum.zoom.us/u/tom_bebraven)\
**Post date:** [November 4, 2022, 5:57pm UTC](https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312/3 "2022-11-04T17:57:30Z")

</div>

Hi Donte!

Thank you for getting back to me so quickly.

Yes, this was made server-to-server from a recurring task. However, I think the registration request immediately followed the auth token request. Here are screenshots from our error-tracking app. (The top one is the auth request, and the second is the failed registration request.)

**Request for token:**

 ![auth_request](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/8/4/84ee9c596c0338b332e20ab6d71dc0e74931992f.png)

**Failed CRUD request:**

 ![crud_request](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/b/e/be34ab9cf59cf388f85bede4a7946aa7d56e3cda.png)

These happened very quickly, and we only run one of these jobs at a time. Could it be something else?

Also, good news is that we had major data error when this job ran; at first I thought it may have been related to the failed Zoom request, but it turns out it’s from another part of the app. So this error is now much more benign! (I still want to understand why it happened and what we can do to prevent it, though.)

Thank you again for your help!

Tom

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [November 4, 2022, 6:28pm UTC](https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312/4 "2022-11-04T18:28:18Z")

</div>

Thanks for the additional context. It sounds like the behavior may have been a by-product of the major data error you mentioned. Is that accurate? Generally, I see the “Invalid access token ” when making subsequent to get an access token. This is because each time you call to get an access token, it invalidates the previous access token that was issued. To prevent this, you can submit a support request to increase the index tolerance, you will be able to generate tokens at different indexes so the tokens won’t get invalidated. Here is the post with more details on this topic you can check out :

> [@Randomly receiving "Invalid access token" for Server-to-Server OAuth](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432):
>
> Starting this week, we have started receiving a lot of errors when calling Zoom APIs with our Server-to-Server OAuth token. { "code": 124, "message": Invalid access token." } When I look at the access token in question, it has not expired…there’s plenty of time left. We also have logic in place to refresh the token well before it’s scheduled to expire. Has something changed about the way Server-to-Server OAuth access tokens are managed on the Zoom side? We’ve had to put in a retry mechanism…

Let me know if this helps.

---

<div class="post-metadata">

**Author:** ![tom\_bebraven](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tom_bebraven/32/42705_2.png) [@tom\_bebraven](https://devforum.zoom.us/u/tom_bebraven)\
**Post date:** [November 4, 2022, 8:51pm UTC](https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312/5 "2022-11-04T20:51:48Z")

</div>

Hi Donte,

Thank you again for your help! We have to hold on re-implementing this functionality for at least another week. It probably is related to our internal data issue. If we still have this problem, I will reach out. And thank you for sharing the other thread!

Tom

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [November 4, 2022, 8:57pm UTC](https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312/6 "2022-11-04T20:57:37Z")

</div>

Okay, cool beans, @tom_bebraven! Let us know if you have any questions when you start re-implementing that functionality.

---

<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 8, 2023, 12:33pm UTC](https://devforum.zoom.us/t/code-124-requests-failing-despite-200-response-for-access-token/78312/7 "2023-11-08T12:33:56Z")

</div>

Closed on November 8, 2023, 12:33pm UTC

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