In order to send a Chatbot Message, you need to generate a Chatbot Token.
Important: Chatbot Tokens are different than OAuth Access Tokens. Chatbot Tokens use the OAuth2 Client Credentials Grant Type, and OAuth Tokens use the OAuth2 Authorization Code Grant Type. That being said, you can still use a single Zoom OAuth App, or Zoom Chatbot App, to generate both a Chatbot Token, and an OAuth Access Token.
How to generate a Chatbot Token:
- Install your Chatbot App from the Marketplace.
-
Make a POST request to
https://zoom.us/oauth/token
with the following query parameters and authorization header:Query Parameter Description grant_type
Value client_credentials
Request Headers Description Authorization
The string “Basic” with your Client ID and Client Secret with a colon : in between, Base64 Encoded. For example, Client_ID:Client_Secret
Base64 Encoded isQ2xpZW50X0lEOkNsaWVudF9TZWNyZXQ=
. -
If successful, the response body will be a JSON representation of the Chatbot token:
{ "access_token": "eyJhbGciOiJIUzUxMiIsInYiOiIyLjAiLCJraWQiOiI8S0lEPiJ9.eyJhdWQiOiJodHRwczovL29hdXRoLnpvb20udXMiLCJ2ZXIiOiI2IiwibmJmIjoxNTgwMTQ2NjkzLCJjbGllbnRJZCI6IjxDbGllbnRfSUQ-IiwiaXNzIjoidXJuOnpvb206Y29ubmVjdDpjbGllbnRpZDo8Q2xpZW50X0lEPiIsImF1dGhlbnRpY2F0aW9uSWQiOiI8QXV0aGVudGljYXRpb25fSUQ-IiwiZXhwIjoxNTgwMTUwMjkzLCJ0b2tlblR5cGUiOiJjbGllbnRfdG9rZW4iLCJpYXQiOjE1ODAxNDY2OTMsInVzZXJJZCI6IjxVc2VyX0lEPiIsImdyb3VwTnVtYmVyIjowLCJqdGkiOiI8SlRJPiJ9.chgzEaGxeYl3alAaLsFSRvQFVRqoabM5BINVELOYPO1FqveoEk02i8AIGrtg0FiX779pMWpMObkxFnPQy7euNA", "token_type": "bearer", "expires_in": 3600, "scope": "imchat:bot" }
Chatbot tokens expire after one hour. Refreshing a Chatbot token is the same process as Requesting a Chatbot Token.
- Use the Chatbot `access_token` to Send a Chatbot Message or call the Chatbot APIs.
For more details, please see the Chatbot Authentication guides on our documentation.