Solved

Webhook or event for inbound customer SMS

  • 26 February 2024
  • 4 replies
  • 31 views

Badge

Hi, is there a way for inbound customer SMS to trigger a webhook to an external platform?

icon

Best answer by Brian Turcotte 25 April 2024, 16:57

View original

4 replies

Userlevel 4
Badge +24

Hey @steven_from_textjoy! Interesting question… the sort answer is maybe, depending on your exact use case. If you could go into more detail on what you’re trying to do I can advise further.  

 

In general, utilizing webhooks is only available with flows at this time but there’s no native inbound SMS flow trigger. There is a workaround to create a custom metric triggered by the inbound SMS that would then trigger a flow based on that metric. Then you could then add the webhook block within that flow.

 

Badge

Hey @kaila.lawrence! Thanks for the reply.

Here’s the flow I’m trying to create:

  1. Customer texts Klaviyo SMS number
  2. Klaviyo triggers flow
  3. Flow hits an external webhook

The custom metric idea seems hacky but interesting. So, you’d create a metric like “Inbound SMS count” or something like that, that triggers every time the count changes?

Couple questions:

  1. How fast is the trigger - ours needs to be instantaneous because it’s a live chat
  2. What info is shared by the trigger? At a minimum, we’d need to have the sender phone number, recipient phone number, timestamp, and message body

Thanks so much!
Steven

Userlevel 4
Badge +24

Admittedly, this is the extent of my knowledge on the situation. I’m going to move this post to the Developer Group where they can go into much more juicy technical detail and advise you further!

Userlevel 7
Badge +36

Hi @steven_from_textjoy!

The use case you referenced is correct - you would need a custom event that triggers a flow (as webhooks are currently only available in flows), and then include the sender phone number, recipient phone number, timestamp, and message body in the payload of the webhook (which is JSON that can be customized).

 

That said, this is a custom use case that is technically beyond the scope of Community/Support, so you’re always welcome to reach out to one of our wonderful Official Partners for extra development help!

 

- Brian

Reply