Bad Request - Consistently getting: {"code": 300, "message": "Must provide either to_contact or to_channel parameter." } when trying to send message

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”,
    “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
    }

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

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

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

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”,
“at_items” : [
{
“at_contact”: “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” ?

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…

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

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