# Chat bot send message without user initiating first

**URL:** <https://devforum.zoom.us/t/chat-bot-send-message-without-user-initiating-first/26331>\
**Category:** API and Webhooks\
**Created:** [August 5, 2020, 3:45pm UTC](https://devforum.zoom.us/t/chat-bot-send-message-without-user-initiating-first/26331 "2020-08-05T15:45:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kebinjj](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@kebinjj](https://devforum.zoom.us/u/kebinjj)\
**Post date:** [August 5, 2020, 3:45pm UTC](https://devforum.zoom.us/t/chat-bot-send-message-without-user-initiating-first/26331/1 "2020-08-05T15:45:42Z")

</div>

**Description**  
I’m working on a chat bot to send alerts to users. The problem is I need the jid of the user to be able to send a message. I tried using GET /users/{email\_here} to get the user jid but it returns an error Invalid api key or secret. The access token works for POST /im/chat/messages so I think the issue is not with the access token. Any advice? Thank you.

**Error**  
{  
“code”: 200,  
“message”: “Invalid api key or secret.”  
}

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**

App Type: Chatbot

**Which Endpoint/s?**  
Knowing the API endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.

Endpoint: GET /users/{userId}

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. Request URL / Headers (without credentials) / Body
2. See error

**Screenshots (If applicable)**  
If applicable, add screenshots to help explain your problem.

**Additional context**  
Add any other context about the problem here.

---

<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:** [August 6, 2020, 9:13pm UTC](https://devforum.zoom.us/t/chat-bot-send-message-without-user-initiating-first/26331/2 "2020-08-06T21:13:02Z")

</div>

Hey @kebinjj,

To call the [Get User endpoint](https://marketplace.zoom.us/docs/api-reference/zoom-api/users/user), you can use your same Chat bot app, but you need to get a user access token instead of a chatbot access token. Checkout the guide here:

> **[OAuth 2.0 - Authorization - Documentation](https://marketplace.zoom.us/docs/guides/auth/oauth#oauth-chatbots)**
>
> OAuth with Zoom
> 
> The Zoom API uses OAuth 2.0 to authenticate and authorize users to make requests. To setup access credentials and request scopes for yo...

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 16, 2020, 9:13pm UTC](https://devforum.zoom.us/t/chat-bot-send-message-without-user-initiating-first/26331/3 "2020-08-16T21:13:05Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
