# 401 error when calling the accounts api of v2

**URL:** <https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874>\
**Category:** API and Webhooks\
**Created:** [January 15, 2018, 2:27am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874 "2018-01-15T02:27:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![xu\_wu](https://avatars.discourse-cdn.com/v4/letter/x/dfb087/32.png) [@xu\_wu](https://devforum.zoom.us/u/xu_wu)\
**Post date:** [January 15, 2018, 2:27am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/1 "2018-01-15T02:27:13Z")

</div>

First, I generated the token using my key and secret.

 ![](https://support.zoom.us/hc/user_images/5A89FzimJj_FbeEXNsNAWw.jpeg)

and then I used the generated token to call the api

 ![](https://support.zoom.us/hc/user_images/2i9XwOAeU8NkQeSibAL-MA.jpeg)

and met the 401 unauthorized error. But I did provide the token, and my key and secret are valid. Somebody help me please. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![harris\_yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/harris_yang/32/155_2.png) [@harris\_yang](https://devforum.zoom.us/u/harris_yang)\
**Post date:** [January 15, 2018, 3:03am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/2 "2018-01-15T03:03:25Z")

</div>

Please get a token from [https://jwt.io](https://jwt.io), then test again.

![]()

---

<div class="post-metadata">

**Author:** ![xu\_wu](https://avatars.discourse-cdn.com/v4/letter/x/dfb087/32.png) [@xu\_wu](https://devforum.zoom.us/u/xu_wu)\
**Post date:** [January 15, 2018, 3:25am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/3 "2018-01-15T03:25:59Z")

</div>

I did generate a token first. And I did it as the zoom api doc told me. Please take a look at my first picture.

---

<div class="post-metadata">

**Author:** ![xu\_wu](https://avatars.discourse-cdn.com/v4/letter/x/dfb087/32.png) [@xu\_wu](https://devforum.zoom.us/u/xu_wu)\
**Post date:** [January 15, 2018, 7:21am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/4 "2018-01-15T07:21:05Z")

</div>

Do I have to pay some money to use the api??? I really don’t know what’s the problem. Because I’ve done exactly as the api said. : (

---

<div class="post-metadata">

**Author:** ![harris\_yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/harris_yang/32/155_2.png) [@harris\_yang](https://devforum.zoom.us/u/harris_yang)\
**Post date:** [January 15, 2018, 7:42am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/5 "2018-01-15T07:42:25Z")

</div>

Please provide the response error message?

---

<div class="post-metadata">

**Author:** ![xu\_wu](https://avatars.discourse-cdn.com/v4/letter/x/dfb087/32.png) [@xu\_wu](https://devforum.zoom.us/u/xu_wu)\
**Post date:** [January 15, 2018, 7:49am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/6 "2018-01-15T07:49:48Z")

</div>

the api is:[https://api.zoom.us/v2/accounts?access\_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJfODJramgtTlRzQ3B6NGpfT090bDJ3IiwiaWF0IjoxNTE2MDAwMTIzLCJleHAiOjE1MTYwMDM3MjN9.HIgtraVudNPfmBVVV\_eExT1ZPi7niDQPWNKaxv1RdsU](https://api.zoom.us/v2/accounts?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJfODJramgtTlRzQ3B6NGpfT090bDJ3IiwiaWF0IjoxNTE2MDAwMTIzLCJleHAiOjE1MTYwMDM3MjN9.HIgtraVudNPfmBVVV_eExT1ZPi7niDQPWNKaxv1RdsU)

the status is: 401 Unauthorized

and the returned json is:

{  
&nbsp; “code”: 124,  
&nbsp; “message”: “Invalid access token.”  
}

you can try it with POSTMAN.

---

<div class="post-metadata">

**Author:** ![xu\_wu](https://avatars.discourse-cdn.com/v4/letter/x/dfb087/32.png) [@xu\_wu](https://devforum.zoom.us/u/xu_wu)\
**Post date:** [January 15, 2018, 7:51am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/7 "2018-01-15T07:51:10Z")

</div>

strange thing!

when I called this api:

[https://api.zoom.us/v2/users?access\_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJfODJramgtTlRzQ3B6NGpfT090bDJ3IiwiaWF0IjoxNTE2MDAwMTIzLCJleHAiOjE1MTYwMDM3MjN9.HIgtraVudNPfmBVVV\_eExT1ZPi7niDQPWNKaxv1RdsU](https://api.zoom.us/v2/users?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJfODJramgtTlRzQ3B6NGpfT090bDJ3IiwiaWF0IjoxNTE2MDAwMTIzLCJleHAiOjE1MTYwMDM3MjN9.HIgtraVudNPfmBVVV_eExT1ZPi7niDQPWNKaxv1RdsU)

it worked well!&nbsp;

---

<div class="post-metadata">

**Author:** ![harris\_yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/harris_yang/32/155_2.png) [@harris\_yang](https://devforum.zoom.us/u/harris_yang)\
**Post date:** [January 15, 2018, 8:01am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/8 "2018-01-15T08:01:20Z")

</div>

This API is used for master account to list all the sub accounts, only available for paid master account. You can test other APIs.

We will update the error message.&nbsp;

---

<div class="post-metadata">

**Author:** ![xu\_wu](https://avatars.discourse-cdn.com/v4/letter/x/dfb087/32.png) [@xu\_wu](https://devforum.zoom.us/u/xu_wu)\
**Post date:** [January 15, 2018, 8:10am UTC](https://devforum.zoom.us/t/401-error-when-calling-the-accounts-api-of-v2/874/9 "2018-01-15T08:10:36Z")

</div>

THANK YOU SO MUCH!!!

This problem has been bothering me for quite a while. Thank you for your explanation.
