Send chat messages via API

We are evaluating Zoom against Webex Teams & MS Teams. We need to create incoming webhooks to post messages into chat channels. We have done this in all 3 products using the provided webhook apps (e.g. ‘Incoming Webhook’ app in Zoom Marketplace). Unfortunately, with Zoom, the notifications on messages sent via webhooks do not include any message content, just ‘app - incoming webhook’. So, the notifications aren’t very useful, unlike Webex/MS Teams, which show a preview of the message in the notification.

So instead we tried to use the Zoom API to post chat messages. This is proving difficult. As far as we can tell there is no way to do this via scripts using JWT. The only way seems to be an OAuth user-level appliction, which means we can’t interact with the API using a script (as per JWT), but have to build a web application?!

It seems crazy that we can’t create simple chat messages with useful notifications in Zoom, using a script. If someone can help us, this would probably make our decision to go with Zoom, as we like everything else about it :slight_smile:

Hey @dan.atkinson, thanks for posting and using Zoom!

This is totally possible with via scripts with a Chatbot App.

Here are the steps:

  1. Simply Create a Chatbot App here.

  2. Enable Event Subscriptions on the Features page, and select which Webhooks you would like to subscribe to.

  3. Install your Chatbot App on the Local Test page (make sure to fill in the required info, you can use a generic redirect URL because that won’t be needed).

  4. Setup a way to accept the Webhooks, then format the JSON body from the webhook in a Chatbot message type of your choice

  5. Then get a Chatbot Token, and Send the Chatbot Message to a Zoom Channel or user.

Let me know if that helps! :slight_smile:

Thanks,
Tommy

Thanks Tommy - We’ll try that out tomorrow and I’ll report back.

1 Like

Sounds good! :slight_smile:

We are here to help!

-Tommy

Hi Tommy - We’ve been working on this today, I have a few questions:

  1. Simply Create a Chatbot App here.

OK we did that, no problems.

  1. Enable Event Subscriptions on the Features page, and select which Webhooks you would like to subscribe to.

We only need to post messages into chat channels, not subscribe to any events happening inside zoom, so I guess this is un-necessary.

  1. Install your Chatbot App on the Local Test page (make sure to fill in the required info, you can use a generic redirect URL because that won’t be needed).

OK this was done.

  1. Setup a way to accept the Webhooks, then[format the JSON body from the webhook in a Chatbot message type of your choice

Not sure what you mean by this, can you please clarify?

  1. Then get a Chatbot Token and Send the Chatbot Message to a Zoom Channel or user

We got the chatbot token OK, but can’t see where to get the required information for posting the message (e.g. robot_jid)

Hey @dan.atkinson,

Okay, yes, in that case this step is not necessary.

Since you don’t need to subscribe to any events, skip that step.

Robot Jid you find in your Chatbot’s settings on the “features” page.

To get the to_jid, you can either:

  1. Setup a User Level OAuth app and GET a channel.

or

  1. Use a Slash Command, which will send the to_jid as a post request to your server.

We are releasing an easier way to get the Channel / User Jids (to_jid) for Chatbots soon.

Thanks,
Tommy

Thanks Tommy.

So we have everything now except the to_jid - and to get get this we need an OAuth app or a Slash command, however, both need some server component on our side to receive the necessary responses?

What is the easier method for obtaining the to_jid and when will it be released?

Hey @dan.atkinson,

Do you have a specific channel or user you want to send this notifications to?

The easiest way to get a to_jid is to combine the userID of who you want the message to go to, with the string: @xmpp.zoom.us.

So if your UserID is abc the to_jid will be abc@xmpp.zoom.us

You can easily get a userID by JWT Decoding the access_token.

Thanks,
Tommy

Hey Tommy - We will want to send the scripted messages to specific channels (not users). What’s the easiest way to get a channel to_jid?

thanks,
Dan

Hey @dan.atkinson,

Here are 3 ways to get a channel to_jid:

  1. Use the Channel Jid helper Chatbot: https://github.com/tommygaessler/channels-chatbot

  2. Use a Slash Command, which will send the to_jid as a post request to your server.

  3. Setup a User Level OAuth app and GET a channel .

In addition to those 3 methods, we are coming out with a way for Chatbots to easily get a list of channels in March / April, so hang tight.

Thanks,
Tommy