r/Zendesk • u/thatfellowabbas • 5h ago
Cool tips & tricks Zendesk's mobile app sucks for messaging/chat, so we built a DIY Slack bridge
Small team here. I handle a lot of our inbound chat myself, often from my phone. Our website chat runs on Zendesk messaging (the Web Widget).
The problem: the Zendesk iPhone app basically can't reply to messaging tickets (not sure if the android app is better or worse). Firstly, the messages don't appear in real time - or appear properly. And when I replied from the app, the customer didn't get it in the chat. It went out as an email. So someone's sitting on the website waiting for an answer, and I'm sending them an email!
So I built a workaround: every website chat becomes a Slack thread, and replying in the thread replies in the chat. Here's how it works in case it helps someone.
The key thing to know first:
- If you post a public comment on a messaging ticket through the normal Zendesk Tickets API, it lands on the ticket but never reaches the customer's chat window.
- The API says success and nothing gets delivered. To post into the actual chat you have to go through the Sunshine Conversations API, which is what Zendesk messaging runs on underneath.
You need a Conversations API key: Admin Center → Apps and integrations → APIs → Conversations API. It's a separate tab from the normal API tokens page.
How it's wired:
Customer to Slack:
- We registered a Sunshine Conversations webhook (a "custom integration") for conversation:message events, pointed at a small endpoint on an internal app we already host (you can just use vercel or something)
- On the first customer message in a conversation, the endpoint posts a parent message in a #live-chat channel. It saves the conversation ID and the Slack thread timestamp to a tiny database table.
- Every later customer message goes into that same thread. One chat = one thread.
Slack to customer:
- A Slack app with Event Subscriptions (message.channels) sends us every message in the channel.
- If it's a human reply inside one of those threads, we look up the conversation and post it to Sunshine Conversations as a business message:
POST /sc/v2/apps/{appId}/conversations/{conversationId}/messages
{ "author": { "type": "business", "displayName": "Abbas", "avatarUrl": "..." },
"content": { "type": "text", "text": "..." } }
It shows up instantly in the customer's chat, with my name and Slack profile photo. It also shows on the Zendesk ticket, so there's still a full record there.
Stuff i messed up and had to fix (so that you don't waste time making them and fixing):
- Sunshine Conversations checks the webhook URL with a HEAD request when you create the integration, and rejects any URL that redirects. Our app's HEAD requests were falling through to a login redirect, so registration kept failing with a vague "was redirected" error. We had to answer HEAD with a plain 200.
- Echo loop: your own replies come back through the webhook as new messages. We tag our outgoing messages with metadata (source: slack-bridge) and skip those on the way in. Otherwise every reply posts itself back into Slack.
- Slack message.groups vs message.channels: groups is for private channels only. Our channel was public, so Slack never sent us anything until we added message.channels.
- Slack's users.info ignores JSON request bodies. We used it to get my name for the reply and sent the user ID as JSON. Slack said "user_not_found", so every reply was signed with our fallback name. Send it as a query parameter instead.
- Slack retries any event you don't acknowledge within 3 seconds. Ignore requests with the X-Slack-Retry-Num header, or one reply can get sent twice.
- If a reply fails, post a warning back into the thread. A reply that silently goes nowhere is exactly the problem you're trying to fix.
Limitations
- Replies show as an API message signed with my name, not as my actual Zendesk agent user. The customer can't tell the difference, but the ticket can.
- If the customer has left and the conversation has gone cold, normal Zendesk rules apply to how it reaches them.
- Not ideal for a big team with routing and assignment. For a small team where a few people cover chat on the go, it's been perfect so far.
Happy to share more detail if anyone wants to build the same thing. Also curious whether anyone found a cleaner way. I couldn't believe the official app just doesn't do this 🥲