Hello! I have what is hopefully something that’s just a small oversight on my part, but I’ve tried everything I can think of and no luck.
Context
I (successfully) built a Chatbot app that works for me locally . The app has the imchat:bot
and chat_channel:read:admin
scopes and everything about it works properly: authentication, sending a custom welcome message via the chatbot on install, getting the list of channels in an account, and posting chatbot messages to a chosen channel.
That was all great, so I decided to set up a new version of the app so that everyone on my team could test it out on a sandbox environment. To do this, instead of creating the app under my own user in Zoom, I created it under our shared engineering team user so that everyone else would have access to modify it too. Both my user and the shared user are in the same Zoom account.
The issue
Long story short, the new app that I created under the shared account almost works, but fails ONLY on the last step when it’s trying to POST
a message to a channel. Auth works, it sends the custom welcome message as a reply to the install webhook, it gets the list of channels in the workspace… but even though the code is exactly the same, the Chatbot API is responding with a 400 code and I can’t for the life of me figure out why.
What I’ve tried to fix this
Many things which didn’t fix it, including:
- Attempting with both production and development credentials.
- Sending the most basic of messages to the API to avoid any accidental formatting issues in the message.
- Trying with markdown support either enabled or disabled.
- Giving the shared user the exact same role that I have, in case it was a permissions issue. The shared user is also a licensed account.
- Installing the app while logged in to my own account, and trying again while logged in to the shared account.
- More than triple checking that all the credentials, bot IDs, and whatnot, are correct.
- POST-ing to both
https://zoom.us/v2/im/chat/messages
andhttps://api.zoom.us/v2/im/chat/messages
cause both are used in the docs.
What I really don’t understand is why the app created from my own account works without issue, but the one that I created with the shared account does not work – and it only fails on this one API call. If the Chatbot wasn’t even being installed I’d understand that something was going wrong, but I can see the Chatbot in the Zoom client and I have access tokens for both the Chatbot API and OAuth APIs for it.
We have many Zoom Apps that have been created with this shared account and have never run into this problem before, this is the first Chatbot we’ve made though. It’s not enough of a solution for me to create the app from my own account and publish that to the marketplace when we’re ready, I need others on the team to be able to access it too.
Example
With actual values replaced. This is the request body we’re sending in Python.
{
'robot_jid': 'abc@xmpp.zoom.us',
'to_jid': 'abc123@conference.xmpp.zoom.us',
'account_id': 'abc-def',
'is_markdown_support': True,
'content': {
'head': {
'text': 'hello'
}
}
}
With the authorization header like this:
{'Authorization': 'Bearer thisIsATokenThatIHaveReplaced', 'Content-Type': 'application/json'}
And the error I’m getting is:
400 Client Error: Bad Request for url: https://zoom.us/v2/im/chat/messages
I’d appreciate help with this please! I’m all out of ideas.