# Bad Request - Consistently getting: {"code": 300, "message": "Must provide either to\_contact or to\_channel parameter." } when trying to send message

**URL:** <https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091>\
**Category:** API and Webhooks\
**Created:** [February 14, 2023, 7:59am UTC](https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091 "2023-02-14T07:59:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiaan.schulz](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tiaan.schulz/32/44686_2.png) [@tiaan.schulz](https://devforum.zoom.us/u/tiaan.schulz)\
**Post date:** [February 14, 2023, 7:59am UTC](https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091/1 "2023-02-14T07:59:24Z")

</div>

API endpoint - https://“company name”.zoom.us/v2/chat/users/:userId/messages

- Description  
Trying to send message to either a channel or a contact in my ORG, but consistently getting the;  
{“code”: 300, “message”: “Must provide either to\_contact or to\_channel parameter.” } in Postman.

- Request URL:  
“company name”.zoom.us/v2/chat/users/:userId/messages

- Headers:  

- Authentication through OAuth & bearer token.

- Response error - 400 Bad request

- JSON Body in postman:  
{  
“at\_items”: [  
{  
“at\_contact”: “[email@company.com](mailto:email@company.com)”,  
“at\_type”: 1,  
“end\_position”: 8,  
“start\_position”: 0  
}  
],  
“rich\_text”: [  
{  
“start\_position”: 0,  
“end\_position”: 1,  
“format\_type”: “Paragraph”,  
“format\_attr”: “h1”  
}  
],  
“message”: “Hello”,  
“to\_channel”: “5F11XXXXXXXXXXXXXXXXXXXXXXX”,  
“to\_contact”: “[recipient@domain.com](mailto:recipient@domain.com)”  
}

Even when I pass either the to\_contact OR to\_channel OR both, I get the same response. Your help would be greatly appreciated,  
Tiaan Schulz

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [February 16, 2023, 9:20pm UTC](https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091/2 "2023-02-16T21:20:32Z")

</div>

Hi @tiaan.schulz  
Thanks for reaching out to the Zoom Developer Forum and welcome to our community.  
Please allow me some time to do some testing on my end and I will come back with an update shortly.  
Best,  
Elisa

---

<div class="post-metadata">

**Author:** ![tiaan.schulz](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tiaan.schulz/32/44686_2.png) [@tiaan.schulz](https://devforum.zoom.us/u/tiaan.schulz)\
**Post date:** [February 17, 2023, 2:35pm UTC](https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091/3 "2023-02-17T14:35:14Z")

</div>

Hi Elisa

Any feedback on this? I have been delayed now for 3 days on my integration?

Your input and support on this would be greatly appreciated,  
Thx

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [February 17, 2023, 4:35pm UTC](https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091/4 "2023-02-17T16:35:24Z")

</div>

Hi @tiaan.schulz  
Thank you for your patience.  
I am not able to replicate this behavior on my end.  
I am able to send a message either to a channel or directly to a contact.

Here is the request body I am sending:

> {  
> “message”: “Hello this is a test and it is working”,  
> “to\_contact” : “[elisa@mail.com](mailto:elisa@mail.com)”,  
> “at\_items” : [  
> {  
> “at\_contact”: “[elisa@mail.com](mailto:elisa@mail.com)”,  
> “at\_type” : 1,  
> “end\_position” : 8,  
> “start\_position” : 0  
> }  
> ],  
> “rich\_text” : [  
> {  
> “start\_position” : 0,  
> “end\_position” : 1,  
> “format\_type” : “Paragraph”,  
> “format\_attr” : “h1”  
> }  
> ]  
> }

If I change the to\_contact for to\_channel, I send the message to a channel instead of directly to the contact.

Could you make sure that you are passing the same email address on the fields “to\_conatc” and “at\_contact” ?

---

<div class="post-metadata">

**Author:** ![tiaan.schulz](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tiaan.schulz/32/44686_2.png) [@tiaan.schulz](https://devforum.zoom.us/u/tiaan.schulz)\
**Post date:** [February 21, 2023, 7:40pm UTC](https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091/5 "2023-02-21T19:40:59Z")

</div>

Hi Elisa

Please ignore my message. I deleted my collection in Postman and re-imported.

Tried then using API call provided there and now seems to work without any issues. Will keep trying and revert if anything changes…

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [February 22, 2023, 12:06am UTC](https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091/6 "2023-02-22T00:06:26Z")

</div>

Hi @tiaan.schulz  
Happy to hear that worked out!

---

<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:** [February 25, 2024, 3:42pm UTC](https://devforum.zoom.us/t/bad-request-consistently-getting-code-300-message-must-provide-either-to-contact-or-to-channel-parameter-when-trying-to-send-message/83091/7 "2024-02-25T15:42:59Z")

</div>

Closed on February 25, 2024, 3:42pm UTC

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