REST API call authentication issues

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 }}"

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 (again, this endpoint is deprecated, but a new one is coming out soon.) you must use an OAuth App Type, or use a Chatbot App Type, and use the OAuth flow to get the proper access_token.

Basically once you install your Chatbot, you will use the code in the redirect url to request an 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

Hey @tommy,

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

Thanks
Prasanth

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 going to solve that problem? If that is the case i can wait until they are ready.

Thanks
Prasanth

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

Hey @prasanth.pendham,

Yes, an Account Level OAuth or Chatbot App Type using the OAuth flow.

Generating an access_token using the Chatbot Auth flow only allows you to call the Send Chatbot Message endpoint.

The access_token lasts for 1 hour. After that you need to refresh it. Since you forgot to save the refresh token, you can start over by re installing the app.

Thanks,
Tommy

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

Hey @prasanth.pendham,

That is the correct functionality for installing / authorizing / getting the authorization code because the user must sign in to Zoom and “Authorize” your app (that cannot be done via CURL).

After the user authorizes tour app, you can use CURL to get an access token, and refresh it once it expires.

Thanks,
Tommy

1 Like

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

Hey @prasanth.pendham,

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

I look forward to chatting!

Thanks,
Tommy

Hi @tommy,

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

Regards
Prasanth

Thanks @prasanth.pendham! See you then!

-Tommy