# REST API call authentication issues

**URL:** <https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901>\
**Category:** API and Webhooks\
**Created:** [September 13, 2019, 5:12pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901 "2019-09-13T17:12:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasanth.pendham](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prasanth.pendham/32/2341_2.png) [@prasanth.pendham](https://devforum.zoom.us/u/prasanth.pendham)\
**Post date:** [September 13, 2019, 5:12pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/1 "2019-09-13T17:12:27Z")

</div>

Hello Team,

I am trying to use below rest api call. I tried it using both chatbot access token and JWT access token.  
And in both the case i keep getting {“message”:“authorization failed:null”,“code”:7010} errors.

GET `/im/users/{{ USER ID }}/channels`

HEADERS: `"Authorization": "Bearer {{ ACCESS TOKEN }}"`

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 13, 2019, 5:23pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/2 "2019-09-13T17:23:43Z")

</div>

Hey @prasanth.pendham,

The authorization flow to call the GET `/im/users/{{ USER ID }}/channels` endpoint is a little different then the Chatbot Credentials and JWT flow.

In order to call the [GET /im/users/{{ USER ID }}/channels](https://devforum.zoom.us/t/questions-related-to-im-users-userid-chat-messages-endpoint/3467/4) (again, this endpoint is deprecated, [but a new one is coming out soon.](https://marketplace.zoom.us/docs/guides/getting-started/stay-up-to-date/upcoming-changes/api)) you must use an OAuth App Type, or use a Chatbot App Type, and [use the OAuth flow to get the proper access\_token](https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom).

Basically once you install your Chatbot, you will use the `code` in the redirect url to [request an access\_token](https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom#request-access-token), and then you can use that to call the GET `/im/users/{{ USER ID }}/channels` endpoint. For example:

POST `https://zoom.us/oauth/token?grant_type=code&code={{ code in redirect url }}&redirect_uri={{ your redirect url }}`

Headers: `"Authorization" : "Basic base64(client_id:client_secret)"`

Will give you the access\_token you need.

Let me know if you have any questions!

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![prasanth.pendham](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prasanth.pendham/32/2341_2.png) [@prasanth.pendham](https://devforum.zoom.us/u/prasanth.pendham)\
**Post date:** [September 13, 2019, 5:46pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/3 "2019-09-13T17:46:13Z")

</div>

Hey @tommy,

Here is my redirect url that i set for my chatbot app [https://marketplace.zoom.us](https://marketplace.zoom.us).  
Also what do you mean by `code in redirect url`.

Thanks  
Prasanth

---

<div class="post-metadata">

**Author:** ![prasanth.pendham](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prasanth.pendham/32/2341_2.png) [@prasanth.pendham](https://devforum.zoom.us/u/prasanth.pendham)\
**Post date:** [September 13, 2019, 5:53pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/4 "2019-09-13T17:53:31Z")

</div>

Hey @tommy,

Is there a simple way to get access to all of zoom rest api using one single access token. My initial understanding was, access token that is generated using chatbot app clientId and clientSecret will work for all api calls.

Are the new upcoming apis [https://marketplace.zoom.us/docs/guides/getting-started/stay-up-to-date/upcoming-changes/api](https://marketplace.zoom.us/docs/guides/getting-started/stay-up-to-date/upcoming-changes/api) going to solve that problem? If that is the case i can wait until they are ready.

Thanks  
Prasanth

---

<div class="post-metadata">

**Author:** ![prasanth.pendham](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prasanth.pendham/32/2341_2.png) [@prasanth.pendham](https://devforum.zoom.us/u/prasanth.pendham)\
**Post date:** [September 13, 2019, 7:53pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/5 "2019-09-13T19:53:45Z")

</div>

Hi @tommy,

I am able to generate access token using

POST `https://zoom.us/oauth/token?grant_type=code&code={{ code in redirect url }}&redirect_uri={{ your redirect url }}`

Headers: `"Authorization" : "Basic base64(client_id:client_secret)"`

Can you please let me know what is the validity time of the access token that is generated? I am asking because i keep getting below message. Also i forgot to save my `refresh token` that was generated

{  
“reason”: “Invalid request : token created error: Save Access token into Database error”,  
“error”: “invalid\_request”  
}

Thanks  
Prasanth

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 13, 2019, 8:08pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/6 "2019-09-13T20:08:01Z")

</div>

Hey @prasanth.pendham,

> [@prasanth.pendham](#):
>
> Is there a simple way to get access to all of zoom rest api using one single access token. My initial understanding was, access token that is generated using chatbot app clientId and clientSecret will work for all api calls.

Yes, an [Account Level OAuth](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app) or [Chatbot](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-chatbot-app) App Type using the [OAuth flow](https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom).

Generating an access\_token using the [Chatbot Auth flow](https://marketplace.zoom.us/docs/guides/chatbots/authorization) only allows you to call the [Send Chatbot Message endpoint.](https://marketplace.zoom.us/docs/api-reference/zoom-api/im-chat/sendchatbot)

> [@prasanth.pendham](#):
>
> Can you please let me know what is the validity time of the access token that is generated?

The access\_token lasts for 1 hour. After that you need to [refresh it](https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom#refresh-access-token). Since you forgot to save the refresh token, you can start over by re installing the app.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![prasanth.pendham](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prasanth.pendham/32/2341_2.png) [@prasanth.pendham](https://devforum.zoom.us/u/prasanth.pendham)\
**Post date:** [September 16, 2019, 3:00pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/7 "2019-09-16T15:00:26Z")

</div>

Hi @tommy

I am trying to get `authorization code` by executing below GET using CURL but it doesnt work. (It only works by putting the url in browser)

GET `https://zoom.us/oauth/authorize?response_type=code&client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_REDIRECT_URI}`

Grab the **authorization code** in the redirect url `https://yourRedriectUrl.com?code={AUTHORIZATION_CODE}`

With curl i get the whole html response as output. How can it be achieved using CURL?

Thanks  
Prasanth

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 16, 2019, 4:51pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/8 "2019-09-16T16:51:44Z")

</div>

Hey @prasanth.pendham,

That is the correct functionality for [installing / authorizing / getting the authorization code](https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom#authorization-code) because the user must sign in to Zoom and “Authorize” your app (that cannot be done via CURL).

 ![15%20AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/4/4224bc880ecdb46cc016429483055378961fc917.jpeg)

After the user authorizes tour app, you can use CURL to [get an access token](https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom#request-access-token), and [refresh](https://marketplace.zoom.us/docs/guides/authorization/oauth/oauth-with-zoom#refresh-access-token) it once it expires.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![prasanth.pendham](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prasanth.pendham/32/2341_2.png) [@prasanth.pendham](https://devforum.zoom.us/u/prasanth.pendham)\
**Post date:** [September 16, 2019, 5:45pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/9 "2019-09-16T17:45:11Z")

</div>

Hi @tommy,

Thanks for confirming but that approach could be a blocker in our automation process where we trying to write a java plugin which can send messages to zoom channels as a part of CI/CD flow. Is it possible to schedule a zoom call with you to explain our use case and get your inputs that can solve our problems.

Thanks  
Prasanth

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 16, 2019, 6:17pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/10 "2019-09-16T18:17:56Z")

</div>

Hey @prasanth.pendham,

Would love to help, you can schedule a Zoom meeting with me here.

I look forward to chatting!

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![prasanth.pendham](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/prasanth.pendham/32/2341_2.png) [@prasanth.pendham](https://devforum.zoom.us/u/prasanth.pendham)\
**Post date:** [September 16, 2019, 6:57pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/11 "2019-09-16T18:57:29Z")

</div>

Hi @tommy,

Thank you. Scheduled one for tomorrow 2:30 PM CT. Looking forward to discuss.

Regards  
Prasanth

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 16, 2019, 7:01pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/12 "2019-09-16T19:01:34Z")

</div>

Thanks @prasanth.pendham! See you then!

-Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 6:42pm UTC](https://devforum.zoom.us/t/rest-api-call-authentication-issues/5901/14 "2020-08-21T18:42:10Z")

</div>


