# Send chat messages via API

**URL:** <https://devforum.zoom.us/t/send-chat-messages-via-api/8524>\
**Category:** API and Webhooks\
**Created:** [March 10, 2020, 3:22pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524 "2020-03-10T15:22:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan.atkinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.atkinson/32/6364_2.png) [@dan.atkinson](https://devforum.zoom.us/u/dan.atkinson)\
**Post date:** [March 10, 2020, 3:22pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/1 "2020-03-10T15:22:48Z")

</div>

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 🙂

---

<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:** [March 10, 2020, 5:17pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/2 "2020-03-10T17:17:12Z")

</div>

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](https://marketplace.zoom.us/develop/create).

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](https://marketplace.zoom.us/docs/guides/chatbots/customizing-messages)

5. Then [get a Chatbot Token](https://marketplace.zoom.us/docs/guides/chatbots/installation-and-authentication#authentication), and [Send the Chatbot Message to a Zoom Channel or user](https://marketplace.zoom.us/docs/guides/chatbots/send-edit-and-delete-messages#send-messages).

Let me know if that helps! 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![dan.atkinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.atkinson/32/6364_2.png) [@dan.atkinson](https://devforum.zoom.us/u/dan.atkinson)\
**Post date:** [March 10, 2020, 5:47pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/3 "2020-03-10T17:47:47Z")

</div>

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

---

<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:** [March 10, 2020, 6:20pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/4 "2020-03-10T18:20:55Z")

</div>

Sounds good! 🙂

We are here to help!

-Tommy

---

<div class="post-metadata">

**Author:** ![dan.atkinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.atkinson/32/6364_2.png) [@dan.atkinson](https://devforum.zoom.us/u/dan.atkinson)\
**Post date:** [March 11, 2020, 12:28pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/5 "2020-03-11T12:28:52Z")

</div>

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

1. Simply [Create a Chatbot App here](https://marketplace.zoom.us/develop/create).

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)

---

<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:** [March 11, 2020, 9:33pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/6 "2020-03-11T21:33:05Z")

</div>

Hey @dan.atkinson,

> [@dan.atkinson](#):
>
> We only need to post messages into chat channels, not subscribe to any events happening inside zoom, so I guess this is un-necessary.

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

> [@dan.atkinson](#):
>
> Not sure what you mean by this, can you please clarify?

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

> [@dan.atkinson](#):
>
> We got the chatbot token OK, but can’t see where to get the required information for posting the message (e.g. robot\_jid)

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

To get the [to\_jid](https://marketplace.zoom.us/docs/guides/chatbots/send-edit-and-delete-messages#send-messages), you can either:

1. Setup a [User Level OAuth app](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app) and [GET a channel](https://marketplace.zoom.us/docs/api-reference/zoom-api/chat-channels/getchannels).

or

1. Use a Slash Command, which will [send the to\_jid as a post request to your server](https://marketplace.zoom.us/docs/api-reference/webhook-reference/chatbot-events/user-commands).

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

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![dan.atkinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.atkinson/32/6364_2.png) [@dan.atkinson](https://devforum.zoom.us/u/dan.atkinson)\
**Post date:** [March 12, 2020, 10:42am UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/7 "2020-03-12T10:42:41Z")

</div>

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?

---

<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:** [March 12, 2020, 6:05pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/8 "2020-03-12T18:05:23Z")

</div>

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](https://jwt.io/) the access\_token.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![dan.atkinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.atkinson/32/6364_2.png) [@dan.atkinson](https://devforum.zoom.us/u/dan.atkinson)\
**Post date:** [March 13, 2020, 11:46am UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/9 "2020-03-13T11:46:44Z")

</div>

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

---

<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:** [March 13, 2020, 5:51pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/10 "2020-03-13T17:51:18Z")

</div>

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](https://github.com/tommygaessler/channels-chatbot)

2. Use a Slash Command, which will [send the to\_jid as a post request to your server](https://marketplace.zoom.us/docs/api-reference/webhook-reference/chatbot-events/user-commands).

3. Setup a [User Level OAuth app](https://marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app) and [GET a channel](https://marketplace.zoom.us/docs/api-reference/zoom-api/chat-channels/getchannels).

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

---

<div class="post-metadata">

**Author:** ![nmatese](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nmatese](https://devforum.zoom.us/u/nmatese)\
**Post date:** [April 16, 2020, 1:52am UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/11 "2020-04-16T01:52:26Z")

</div>

@dan.atkinson were you able to get this going? I’m trying to do something very similar. Specifically trying to get my Zabbix monitoring server to send a message to a specific channel.

---

<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:** [April 16, 2020, 6:49am UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/12 "2020-04-16T06:49:30Z")

</div>

Hey @nmatese,

Are you seeing an error message? If so, please share more details and steps to reproduce the issue.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![nmatese](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nmatese](https://devforum.zoom.us/u/nmatese)\
**Post date:** [April 16, 2020, 2:52pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/13 "2020-04-16T14:52:37Z")

</div>

@tommy

This is what I am using, note I’ve replaced my info with XXXX.

var params = JSON.parse(value),  
req = new CurlHttpRequest(),  
resp;

var data = “{\n “is\_markdown\_support”: true,\n “body”: {\n “text”: “\<!all\> test simple message”\n }\n}”;

req.AddHeader(‘Content-Type: application/json’);  
req.AddHeader(‘Authorization: xxxxxxxx’);  
resp = req.Post(‘[https://inbots.zoom.us/incoming/hook/XXXXXXX?format=full](https://inbots.zoom.us/incoming/hook/XXXXXXX?format=full)’,  
data  
);  
return resp;

The error I am getting is Internal Server Error.

---

<div class="post-metadata">

**Author:** ![nmatese](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nmatese](https://devforum.zoom.us/u/nmatese)\
**Post date:** [April 17, 2020, 3:30pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/14 "2020-04-17T15:30:08Z")

</div>

@tommy any thoughts on how to resolve the internal server error?

---

<div class="post-metadata">

**Author:** ![dan.atkinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.atkinson/32/6364_2.png) [@dan.atkinson](https://devforum.zoom.us/u/dan.atkinson)\
**Post date:** [April 17, 2020, 3:47pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/15 "2020-04-17T15:47:47Z")

</div>

Hi - No i didn’t get it working, we gave up for the time being, and all our webhooks are still running in Webex Teams, which is working great and very easy to configure.

I will revisit Zoom webhooks at some point - hopefully they can make it easier like Webex & MS Teams, although given the freeze on new features and security-focus, I guess this won’t be anytime soon.

---

<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:** [April 19, 2020, 5:48am UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/16 "2020-04-19T05:48:57Z")

</div>

Hey @nmatese,

Are you using the [Incoming Webhook Bot](https://marketplace.zoom.us/apps/eH_dLuquRd-VYcOsNGy-hQ)? Or sending [Chatbot messages?](https://marketplace.zoom.us/docs/guides/chatbots/send-edit-and-delete-messages)

Your request body is also missing the parent configuration object, it should be like this:

```json
{
   "robot_jid": "v1m0yn1imztuogsxjje8fdew@xmpp.zoom.us",
   "to_jid": "kdykjnimt4kpd8kkdqt9fq@xmpp.zoom.us",
   "account_id": "gVcjZnWWRLWvv_GtyGuaxg",
   "content": {

   }
}

```

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![nmatese](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nmatese](https://devforum.zoom.us/u/nmatese)\
**Post date:** [April 19, 2020, 12:27pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/17 "2020-04-19T12:27:07Z")

</div>

@tommy I am using the incoming webhook. It works just fine if I send ?format=fields rather than full. How would I get the jid and ids for the webhook?

---

<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:** [April 20, 2020, 11:58pm UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/18 "2020-04-20T23:58:31Z")

</div>

Hey @nmatese,

Since you are using the incoming webhook app you don’t need to set the jid and ids, ignore that haha. 🙂

That is correct, [follow the docs here](https://zoomappdocs.docs.stoplight.io/incoming-webhook-chatbot) for sending messages via the incoming webhook app.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![nmatese](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nmatese](https://devforum.zoom.us/u/nmatese)\
**Post date:** [April 21, 2020, 12:29am UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/19 "2020-04-21T00:29:30Z")

</div>

@tommy That brings me back to my original question where I listed my code. I get an internal server error. It works fine when I set format=fields but not when I set to format=full.

My whole goal here is to add a mention so that I will get push notifications on my phone when a message arrives in that channel. Currently the webhook sends the message to the channel but no notification when I send format=fields.

Thanks!

---

<div class="post-metadata">

**Author:** ![dan.atkinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.atkinson/32/6364_2.png) [@dan.atkinson](https://devforum.zoom.us/u/dan.atkinson)\
**Post date:** [April 21, 2020, 8:00am UTC](https://devforum.zoom.us/t/send-chat-messages-via-api/8524/20 "2020-04-21T08:00:46Z")

</div>

The problem we found with the ‘incoming webhook’ app is that the message notifications say ‘incoming webhook message’ or similar, rather than giving a preview of the message. This makes the notifications pretty useless, hence we can’t use incoming webhook app ☹

[Next page](https://devforum.zoom.us/t/send-chat-messages-via-api/8524.md?page=2)
