# Error when get call\_logs {"code":401,"message":"The account access token is invalid"}

**URL:** <https://devforum.zoom.us/t/error-when-get-call-logs-code-401-message-the-account-access-token-is-invalid/77503>\
**Category:** Phone\
**Created:** [October 17, 2022, 4:40pm UTC](https://devforum.zoom.us/t/error-when-get-call-logs-code-401-message-the-account-access-token-is-invalid/77503 "2022-10-17T16:40:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlsilva](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@tlsilva](https://devforum.zoom.us/u/tlsilva)\
**Post date:** [October 17, 2022, 4:40pm UTC](https://devforum.zoom.us/t/error-when-get-call-logs-code-401-message-the-account-access-token-is-invalid/77503/1 "2022-10-17T16:40:12Z")

</div>

### Before Creating a New Topic:

I’m using the Phone API to retrieve logs using this endpoint [https://api.zoom.us/v2/phone/call\_logs](https://api.zoom.us/v2/phone/call_logs) and I’m getting inconsistent responses while doing that.  
I’m using a server-to-Server OAuth app and it’s using the correct permissions.

Very frequently I get HTTP 400 and `{"code":401,"message":"The account access token is invalid"}` and doing the same request I get the expected answer.

What are your suggestions to deal with this issue? Is this issue known on your side?

Kind regards

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [October 19, 2022, 1:10am UTC](https://devforum.zoom.us/t/error-when-get-call-logs-code-401-message-the-account-access-token-is-invalid/77503/2 "2022-10-19T01:10:05Z")

</div>

Hi @tlsilva ,

This is not expected behavior. Can you please note the next time the request fails and then works? Please create a support ticket with the full request bodies and response so the support team can evaluate on the backend.

Thanks!

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [October 19, 2022, 1:24pm UTC](https://devforum.zoom.us/t/error-when-get-call-logs-code-401-message-the-account-access-token-is-invalid/77503/3 "2022-10-19T13:24:07Z")

</div>

I suspect you’re hitting the same “feature” we did, where another service/host is requesting a new Server-to-Server OAuth token and invalidating the one you are using in this particular instance:

> [@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/22):
>
> For posterity and anyone else who happens to run across this thread while scratching their head about how Server-to-Server OAuth works: Requesting a new Server-to-Server OAuth token invalidates the previous one. Zoom can increase the “index” count for your account, allowing you to request different tokens with different indexes that do not interfere with each other (i.e. requesting a token for index 1 doesn’t invalidate the token requested for index 2). The token index is specified in the call…

---

<div class="post-metadata">

**Author:** ![tlsilva](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@tlsilva](https://devforum.zoom.us/u/tlsilva)\
**Post date:** [October 19, 2022, 7:53pm UTC](https://devforum.zoom.us/t/error-when-get-call-logs-code-401-message-the-account-access-token-is-invalid/77503/4 "2022-10-19T19:53:05Z")

</div>

Hi David, Our code was not changed and we don’t see the issue anymore. It hasn’t been failing since yesterday. If the situation changes I will let you know reporting the exact request and response.

Thank you.
