# Invalid S2S Access Token

**URL:** <https://devforum.zoom.us/t/invalid-s2s-access-token/88718>\
**Category:** API and Webhooks\
**Tags:** api, s2s-oauth\
**Created:** [May 20, 2023, 2:56am UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718 "2023-05-20T02:56:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishekkumar](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/abhishekkumar/32/47730_2.png) [@abhishekkumar](https://devforum.zoom.us/u/abhishekkumar)\
**Post date:** [May 20, 2023, 2:56am UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/1 "2023-05-20T02:56:06Z")

</div>

**API Endpoint(s) and/or Zoom API Event(s)**  
[_Link the API endpoint(s) and/orZoom API Event(s) you’re working with to help give context._](https://zoom.us/oauth/token/)

**Description**  
On creating S2S Access Token for the first time, I am getting Invalid Access Token while adding hosts, but when I regenrated the token it worked correctly. This is happening more than once now. How do I resolve this?

**Error?**  
Invalid Access Token

**How To Reproduce**  
_Steps to reproduce the behavior:_  
\*1. Add credentials for creating S2S Access TOken  
\*2. Generate the token  
\*3. Sometimes I’m getting Invalid Access Token

---

<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:** [May 22, 2023, 1:16pm UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/2 "2023-05-22T13:16:36Z")

</div>

Hi @abhishekkumar  
Thanks for reaching out to us!  
Could you please make sure that you are not generating more than 1 token at a time?  
With server to server Oauth tokens, you can only have 1 active token, so if you generate a new token, the previous one will be invalidated.  
This could be causing the invalid access token error you are seeing.

---

<div class="post-metadata">

**Author:** ![abhishekkumar](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/abhishekkumar/32/47730_2.png) [@abhishekkumar](https://devforum.zoom.us/u/abhishekkumar)\
**Post date:** [May 22, 2023, 1:30pm UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/3 "2023-05-22T13:30:17Z")

</div>

@elisa.zoom It happened for a new token i generated, the token was working fine after regenerating again. I faced it more than once.

---

<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:** [May 22, 2023, 3:48pm UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/4 "2023-05-22T15:48:47Z")

</div>

Hey @abhishekkumar  
Is this still happening today?  
Whenever this happens again, could you please save the access token and the request you sent and share them with me? You can ping me here and once you have that information I will send you a Direct Message and that way you will be able to send that token privately

---

<div class="post-metadata">

**Author:** ![abhishekkumar](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/abhishekkumar/32/47730_2.png) [@abhishekkumar](https://devforum.zoom.us/u/abhishekkumar)\
**Post date:** [May 23, 2023, 7:06am UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/5 "2023-05-23T07:06:39Z")

</div>

**zoom token -**

The token was generated just now and when we are trying to add an user we can getting `Invalid access token`. The next time when we are regenerating access token it’s working when we regenerated it.

on decoding the token:

```auto
{
  "aud": "https://oauth.zoom.us",
  "uid": "2
  "ver": 9,
  "nbf": 1684824624,
  "code": "7
  "iss": "z
  "gno": 0,
  "exp": 1684828224,
  "type": 3,
  "iat": 1684824624,
  "aid": "rfNk
}

```

can we check this ?

---

<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:** [May 23, 2023, 8:46pm UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/6 "2023-05-23T20:46:17Z")

</div>

I will send you a private message to follow up @abhishekkumar

---

<div class="post-metadata">

**Author:** ![lloyd.weber](https://avatars.discourse-cdn.com/v4/letter/l/b5a626/32.png) [@lloyd.weber](https://devforum.zoom.us/u/lloyd.weber)\
**Post date:** [May 26, 2023, 3:11pm UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/7 "2023-05-26T15:11:14Z")

</div>

I have a similar question: We are seeing an HTTP 400 “Bad Request” response from some of our Zoom API calls. The body message is “Invalid access token.”

---

<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:** [May 31, 2023, 7:51pm UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/8 "2023-05-31T19:51:25Z")

</div>

Hi @lloyd.weber  
Make sure that your access\_tokens are valid.  
With the server to server oauth app, when you generate a new token, the previous one gets invalidated

---

<div class="post-metadata">

**Author:** ![lloyd.weber](https://avatars.discourse-cdn.com/v4/letter/l/b5a626/32.png) [@lloyd.weber](https://devforum.zoom.us/u/lloyd.weber)\
**Post date:** [May 31, 2023, 8:17pm UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/9 "2023-05-31T20:17:19Z")

</div>

Hi Elisa, thanks for your response. I do take care to replace the old access token when we generate a new one. I have some details about the error we are seeing, I wonder if you would be able to use the tracking code below to determine the cause of the error?

We are seeing an HTTP 400 “Bad Request” response from some of our Zoom API calls. The body message is “Invalid access token.” We have seen this both in a production account and QA accounts. It does not happen every time.

This result is from a query to get a phone user profile, e.g. GET “accounts/{accountId}/phone/users/{userId}”. The log info, from an example using a production account, is below. Some relevant data from the log:

Account Id = Tm8NBVszRdmL-A1s52mOOA  
User Id = 9VftMZP-ToOg9idf6ypWYw  
Query: GET: URL=[https://api.zoom.us/v2/accounts/Tm8NBVszRdmL-A1s52mOOA/phone/users/9VftMZP-ToOg9idf6ypWYw](https://api.zoom.us/v2/accounts/Tm8NBVszRdmL-A1s52mOOA/phone/users/9VftMZP-ToOg9idf6ypWYw)  
Tracking Id: WEB\_29b99fb5a701472abb7a42270b57db86

2023-05-23 00:33:39,652 ERROR ZOOM-3661-group-Tm8NBVszRdmL-A1s52mOOA-collector (txnid=2ymr17edlhzjmeax,appid=100):RestServiceUnirestImpl Throwing exception for response: HTTP Status=400, Status Text=Bad Request, Headers={date=[Tue, 23 May 2023 00:33:39 GMT], content-length=[46], server=[cloudflare], x-zm-region=[VA], cf-ray=[7cb9356e5bd48cc6-EWR], vary=[Origin, Access-Control-Request-Method, Access-Control-Request-Headers], x-frame-options=[deny], cf-cache-status=[DYNAMIC], strict-transport-security=[max-age=31536000; includeSubDomains], nel=[{“success\_fraction”:0.01,“report\_to”:“cf-nel”,“max\_age”:604800}], content-type=[application/json], connection=[keep-alive], report-to=[{“endpoints”:[{“url”:“https://a.nel.cloudflare.com/report/v3?s=omkdLkR5hsepknNqI6kJ5kAf40aUmbSD2TvzkBZfhOm%2Frr3Fb1j4IklP%2FgEv1P8W114slOwiqGWl7a9qMTsXmKFnm6fkoQ6w1C9goc5aJKurpHCF5Hu5EKxPqaX5”}],“group”:“cf-nel”,“max\_age”:604800}], x-zm-trackingid=[WEB\_29b99fb5a701472abb7a42270b57db86], alt-svc=[h3=“:443”; ma=86400, h3-29=“:443”; ma=86400]}, Body={“code”:401,“message”:“Invalid access token.”}, Request=Executing GET: URL=[https://api.zoom.us/v2/accounts/Tm8NBVszRdmL-A1s52mOOA/phone/users/9VftMZP-ToOg9idf6ypWYw](https://api.zoom.us/v2/accounts/Tm8NBVszRdmL-A1s52mOOA/phone/users/9VftMZP-ToOg9idf6ypWYw), Headers={authorization=[Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJZeGxuYlhmM1R0UzJpV3o0djNHeXJnIiwiZXhwIjoxNjg0ODA1NjE5fQ.jKNunzbc6eZX0cXynF\_7ViOpJAOT5jZRfJBcaiK0P4Q], accept-encoding=[gzip], accept=[application/json], user-agent=[unirest-java/3.1.00]}, Body=none

Thank you,

---

<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:** [June 7, 2023, 1:48pm UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/11 "2023-06-07T13:48:59Z")

</div>

Hi @lloyd.weber  
Sorry for the late reply here  
I have created an internal ticket with our Engineering team and will update you as soon as I hear back from them (ZSEE-95349 for your reference)  
Cheers,  
Elisa

---

<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:** [June 10, 2024, 5:25am UTC](https://devforum.zoom.us/t/invalid-s2s-access-token/88718/12 "2024-06-10T05:25:04Z")

</div>

Closed on June 10, 2024, 5:25am UTC

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