Solved

Webhooks for Custom integrations

  • 4 November 2021
  • 13 replies
  • 938 views

Badge +2
  • Contributor IV
  • 9 replies

Are custom webhooks on the dev schedule?

It would be very nice to trigger a flow that could communicate unsubscribes to our custom CRM.

At the present it feels like we need to cron a script on our end to either make a request for the unsubscribe metric or we need to move people to a special list on unsubscribes and check that list.

Please correct me if there is a better way, but also appreciate that this would all be better if Klaviyo’s server would talk back when it had something to communicate.

 

icon

Best answer by Taylor Tarpley 5 November 2021, 17:46

View original

13 replies

Userlevel 7
Badge +60

Hi @mac , 

 

Thanks for sharing your question with us! 

 

Unfortunately, custom web hooks isn’t a supported feature. We can only receive data via Webhooks, but we don't currently support webhooks sending data from Klaviyo. However, I will share this feedback wit the product team on your behalf! 

 

Although this is not a currently available, a potential workaround could be accomplished using API to export data to your CRM. Our Klaviyo Partners are more than happy and available to work with you and accomplish the custom setup you want! 

 

Thanks for being a part of the Community! 

-Taylor 

 

Badge +2

Thank you for the answer about Klaviyo initiating the communication.

Does anyone have thoughts on the following part of my communication?

We are not looking for anyone to write anything for us, we are looking for confirmation that this API based approach is at least a decent one, but that we would be open to a different method.

 

At the present it feels like we need to cron a script on our end to either make a request for the unsubscribe metric or we need to move people to a special list on unsubscribes and check that list.

Please correct me if there is a better way,

 

Follow up question:

Are there any existing solutions for this problem in the “library” of supplied integrations? Since our platform is a custom one I did not dig into the integrations offered for say Magento. Does Kalviyo offer what I am asking for in any of those and can we enable one feature of an integration or are those all or nothing? My thought being my team can easily create the necessary code on our end to support such a mechanism and that solution would be a better one than constantly having to ask Klaviyo servers.

 

Please feel free to request clarification if anything I have said is unclear.

Userlevel 5
Badge +18

 

We can only receive data via Webhooks

 

@Taylor Tarpley (or anyone else),

 

Where can I find documentation for receiving webhooks? I’m trying to make a custom integration and already have the data packaged on JSON from the source. I’m currently sending it to Zapier and then trying to make a custom event from there, but I’m running into limitations.

And if you say Klaviyo already accepts webhooks, I could cut out the step with Zapier completely.

Thank you!

Badge +2

 

We can only receive data via Webhooks

 

@Taylor Tarpley (or anyone else),

 

Where can I find documentation for receiving webhooks? I’m trying to make a custom integration and already have the data packaged on JSON from the source. I’m currently sending it to Zapier and then trying to make a custom event from there, but I’m running into limitations.

And if you say Klaviyo already accepts webhooks, I could cut out the step with Zapier completely.

Thank you!

 

Howdy Dave,

I believe you are after their REST API.

https://help.klaviyo.com/hc/en-us/articles/360045726811-Getting-Started-with-Klaviyo-APIs

Userlevel 7
Badge +60

Hi all, 

 

Sorry, I wasn’t 100 % on this, I believe I misspoke earlier! Let me clarify, Klaviyo only receives data via webhooks from a Klaviyo built integration. So, @DavidSandel, you will need to keep using Zapier, however, you can use our Rest API that @mac graciously linked in case your want to use this instead of webhooks. If you want to investigate our API documentation more, you can explore it here

 

Yes, @mac, your API based approach is a great one! This post might also be of use to you to read and glean some additional insight.

 

Finally, to your follow up question as well, yes there is  a library of integrations  you can check out. In fact, Zapier, as David mentioned, is one of them! However, integrations do tend to usually be an all-or-nothing situation, but this could differ. 

 

Thanks for asking these awesome questions in the Community! 

-Taylor 

Userlevel 5
Badge +18

Hello,

I finally had a chance to get back around to this, and still can’t get the most basic data sent into Klaviyo using Zapier webhooks. I don’t think the REST API will work in my case since I believe I need to be using the Track & Identify endpoint.

Here is my setup:

 

I’ve been using the link above as a guide as well is this for making a fully-custom e-comm integration:

Anyways, I have a feeling this is going to be a Zapier problem, but I thought someone might be able to spot an easy mistake as to why this data isn’t being written into Klaviyo.

 

Thanks!

Userlevel 5
Badge +18

Hi @Taylor Tarpley,

I know you can’t offer official support, but can you have a look at my Zapier setup above and let me know if there’s anything obviously wrong?

Hopefully it’s something simple like a missing comma. 😬🤞

Userlevel 2
Badge +9

Hi @DavidSandel regarding what happens in Zapier.  Do you know how soon after the Identify call the Track call is made?

You see the effect of Identify calls is not immediate and there is another form of the identify call with a callback implemented as below that would ensure identify is made before calling the track command:

function onIdentifyCompleteCallback () {
_learnq.track("Neat Event");
}

_learnq.identify(identityProperties, undefined, undefined, onIdentifyCompleteCallback)

 

Let me know if you have any questions.

Userlevel 5
Badge +18

@klaviyojad - Ah. You might be onto something here. Is the Identify call required to be paired with the Track call? It didn’t specifically state that in the API docs here:

or here:

It seems like it would be unnecessary since the Track call also requires the same “token” and “$email” fields to identify the contact and register the event. 

At any rate, if you’re correct and it requires a Track and Identify pair, would this even be possible with Zapier? Can I just have two separate Webhook POST steps, one after the other, to execute sequentially?

Thank you.

Userlevel 5
Badge +18

SOLVED!

 

I just had to change the header to “Content-Type == application/json”.

 

Now let’s see if I can get the rest of more complex data in there.

Userlevel 4
Badge +10

Hi Mac, I realize its been a year+ now but wanted to make sure you saw that Klaviyo released what you’re asking for, I think. Its the ability to add a webhook event to a Flow - ie: trigger events in other applications when a flow is triggered. https://developers.klaviyo.com/en/docs/how_to_add_a_webhook_action_to_a_flow

Userlevel 3
Badge +4

For our use case, we provide merchants with targeted signup forms then send the leads to Klaviyo. We need to be alerted when a pending subscriber clicks the email confirmation link (a.k.a. the “Subscribed to List” trigger) so we can mark that signup as complete and close the loop. A webhook seems like the most logical way to accomplish this.

I wish there were webhook topic APIs we could use to list active webhooks and activate new ones programmatically.

I’d imagine creating a new one would go something like:

curl --request POST \
--url https://a.klaviyo.com/api/webhooks \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"data": {
"topic": "list/subscribe",
"url": "https://api.popsmash.com/klaviyo/webhooks"
}
}
'

 Then be able to see all active webhooks:

curl --request GET \
--url https://a.klaviyo.com/api/webhooks \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/json'

== RESPONSE ==

{
"data": [
{
"created": "2023-03-01T23:41:59.476719+00:00",
"id": "31GTFRVPS27YXTJ7P72HNQD463",
"topic": "checkout/started",
"url": "https://hooks.zapier.com/hooks/9203917..."
},
{
"created": "2023-03-01T23:45:48.673312+00:00",
"id": "01GT27P72H7YXTJNQD463FRVPS",
"topic": "order/created",
"url": "https://hooks.zapier.com/hooks/9028364..."
},
{
"created": "2023-03-01T23:48:12.788878+00:00",
"id": "71GTHNQD463FRVPS2P727YXTJ7",
"topic": "list/subscribe",
"url": "https://api.popsmash.com/klaviyo/webhooks"
}
]
}

And of course, be able to delete when done:

curl --request DELETE \
--url https://a.klaviyo.com/api/webhooks/71GTHNQD463FRVPS2P727YXTJ7 \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/json'

 

Userlevel 7
Badge +36

Hi @popsmash!

 

That is an interesting use case - I’ll definitely forward this to our Product Team to see if there are any plans to allow for this functionality in the future.

 

Thanks,

Brian

Reply