Recent searches


No recent searches

Creating tickets in which agents can reply via SMS



Posted Feb 04, 2025

We have a piece of product infrastructure that nudges users when they have gone dark. There are some common patterns for this, so we send out SMS messages offering to help in specific areas. If the user replies to that text message, our infrastructure generates a Zendesk ticket via the API so our coaches can follow-up and help. 

 

This is the high-level data flow for the API.

 

  1. Search for an agent we'd like to assign the ticket to.
  2. Search for the user using their phone number
    1. If no user is found, create the account
  3. Build the ticket payload
  4. Call the POST tickets.json endpoint to create the ticket
  5. Create a ticket comment that includes the user's SMS message reply (this drives Zendesk triggers)

My understanding from the API docs is that I can use the “via” property to define the ticket as an SMS message, which then unlocks the “SMS” option in the response panel. 

 

This works correctly. However, when I add a comment using the SMS option, no message is sent out. There is nothing in the audit log and there are no status messages in the Channel→Text view in the admin panel. It's as if nothing happened beyond adding a comment to the ticket. 

Here is the payload of my ticket creation call:

    const ticket = {
        subject: `Message from ${messageDetails.userName}`,
        via: {
            channel: "sms",
            from: {phone:phone},
            to: {phone:process.env.ZENDESK_SMS_NUMBER ?? ""}
        },
        comment: {
            html_body: msgBody,
            public: false
        },
        requester: {
            name: messageDetails.userName,
            phone: phone
        },
        recipient: process.env.ZENDESK_SMS_NUMBER ?? "",
        tags: zendeskTags,
        assignee_id: null as number | null
    };

 

I have experienced with different versions of this payload as well. I'v tried adding from_messaging_channel: true

 

How can I troubleshoot this behavior on the Zendesk side? Am I misunderstanding this flow?

 

Thanks!

 

Greg

 


0

2

2 comments

I've discovered that if I make the follow-on comment public, the SMS send works as expected. 

 

I found this nugget inside of the Admin Panel under Tickets→ Settings:

 

[ ] Set composer to public channel by default

When turned on, tickets open with the composer set to a public channel (applicable to email, webform, API ticket, and SMS). When turned off or when tickets contain only internal notes, the composer is set to internal notes.

 

Is that the root cause? How do I disable this behavior?

 

0


Found it.  The root cause appears to be the fact that all comments on the ticket are private. If I flip the follow-on comment to be public, the SMS sends as intended.
 

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post