Sending messages directly from my account to a zoom account

I have a website and i create a zoom email to each employee in it. I want a way to contact with them using their zoom accounts.
I have a zoom account and i want to add a button in the website to send a message to a specific employee on his zoom account from my account but i don’t know what should i do

Hi @quranonlinemessage,

Welcome to the Zoom Developer Community.

You can use the Send IM Messages API to send a message to a user within your account.

There are two things you should know while using this API:

  • This api will send a message to the user in his Zoom Client, and not to his email.
  • This API only supports oauth2. Your JWT token will not be supported.

Please let me know if you have any questions.

Thanks

[P.S: You can send a message to any user who is in your contacts or to a channel that you are a member of. The user need not be within your account]

When i tried to send a message to a contact in my account it responded with this
{
“code”: 200,
“message”: “This Zoom User is not the correct contact or a member of the channel.”
}

Hey @quranonlinemessage,

What are you passing in for the chat_user query param?

Thanks,
Tommy

I am sorry i did something wrong

@quranonlinemessage

Were you able to resolve your issue?

I am still learning and this the first try to build an API so it’s difficult for me to build one.
i will learn then try to make this API

@quranonlinemessage No issues, Please let us know if you have any other questions.

Yes can you please tell me how to do this step-by-step or send me videos that will help me in doing this ?

Hey @quranonlinemessage,

If you are unfamiliar with OAuth, read this.

To do what you want with the Zoom API:

  1. To connect your employees with their Zoom accounts, create a OAuth App (User-Level).
  2. Then you will be able to have your employees “Login with Zoom” via your button, which will give you (your server) an access_token (that you should store with database a on per user basis) for each user that logs in.
  3. With the access_token, you can call the Zoom API’s, specifically the Send IM Messages endpoint.

Example:

POST https://api.zoom.us/v2/im/users/me/chat/messages?chat_user={{ email or user ID here }}

Request Headers:

{
  "authorization": "Bearer {{ access_token here }}"
}

Request Body:

{
  "message": "message here"
}

We do not have any video tutorials at this time.

Let me know if this helps!

Thanks,
Tommy

2 Likes

I did the first setup but when i tried to send a message to a contact in my account it is responded with this

{
    “code”: 200,
    “message”: “This Zoom User is not the correct contact or a member of the channel.”
}

this is the contact

if i changed the chat_user to my account it works fine and sends message to me.


in my website i have two user types {parent and teacher}. the parent has a button on his account when he press on it should send a message from the admin account(my account) to the teacher account to tell him that the parent’s student will not be able to take the class.

@quranonlinemessage what is the value that you are using for the chat_user? Is it the email or the user's ID?

If you are using the user’s ID, can you try switching to the user’s email or vice versa, and let me know if it works? If you need to get the user’s ID, you can use this API:

Thanks,

1 Like

OK can you please tell me if it is possible to send messages from my account(in the back-end) by another one without signing in.

Hey @quranonlinemessage,

I just tested sending a message to a user outside my Zoom account, but in my contacts and it worked.

I think the reason you are getting the error This Zoom User is not the correct contact or a member of the channel. is because that contact did not accept your contact request. Looking at your screenshot, the contacts under the “External” group are the contacts who have accepted and who you can send messages to.

Here is more info on approving a contact request.

If you are still getting the error, what are you passing as the chat_user value? I need to know so I can help debug.

Thanks,
Tommy

1 Like

It worked when i tried another account (ending with @gmail.com ) but when i tried to send it to company contacts which ending with my domain name like my account (@quranonlinemessage.com) it didn’t work.


Also, I don’t want company directory I want to remove it from my employees accounts.

Hey @quranonlinemessage,

To send a message to your company contacts, can you try passing in the userID instead of the @quranonlinemessage.com email?

https://api.zoom.us/v2/im/users/me/chat/messages?chat_user={{ USER_ID }}

You can get a list of userIDs from this endpoint.

Thanks,
Tommy

Ok I want to remove the company directory from accounts

Hey @quranonlinemessage,

Unfortunately you cannot do that at this time.

Thanks,
Tommy

1 Like