Skip to main content
Solved

Understanding webhook url and header.

  • November 8, 2024
  • 6 replies
  • 60 views

Forum|alt.badge.img+1

 

Lead scoring in klaviyo?

4 different flows that adds certain amount of points to the lead score property value.
I need help answering these 6 questions.

But I won't seam to get it to work.
The Json body is all done but that's about it. (Source https://www.klaviyo.com/blog/solution-recipe-13-lead-scoring-in-klaviyo)

{
    "token": "[public key]",
    "properties": {
      "$email": "{{ person.email }}",
      "Lead_Score": {{ person|lookup:'Lead_Score'|default:0|add:'2'}}
    }
}

  1. Destination url? how do I find it or what is it? Tried reading but don’t understand
  2. Header? what to write?
  3. The business public api or make a private api?
  4. Change the "token" in the json body?
  5. If i want to remove points from the value, what word do I replace the “add” with?

 

Best answer by Christiannoerbjerg

Hi @

Thank you for posting in the Community!

You could try the following: 

  1. Destination url? how do I find it or what is it? Tried reading but don’t understand
    - https://a.klaviyo.com/api/track
     
  2. Header? what to write?
  • Content-Type": "application/json"
  1. The business public api or make a private api?-
  • I would go with the public API. 
  1. 4. Change the "token" in the json body?
  • { "token": "YOUR_PUBLIC_API_KEY", "properties": { "$email": "{{ person.email }}", "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|add:'2' }}" } }
  1. If i want to remove points from the value, what word do I replace the “add” with?
  • You could try with this function: "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|subtract:'2' }}"

Hope that helps! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov

View original
Did this topic or the replies in the thread help you find an answer to your question?

6 replies

DavidSandel
Partner - Silver
Forum|alt.badge.img+21
  • Partner - Silver
  • 155 replies
  • November 8, 2024

Unfortunately, that article is out of date. Which means your JSON body is too.

It asks you to call the Identify API which no longer exists. Instead, you have to use the Update Profile endpoint with the email address.


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 3 replies
  • November 8, 2024

Okay thank you. 

Will edit my text :) 


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 3 replies
  • November 8, 2024

The Json body is the least of my problem though. 

I have no idea what to put in the header or destination url? 


Christiannoerbjerg
Expert Problem Solver II
Forum|alt.badge.img+12

Hi @

Thank you for posting in the Community!

You could try the following: 

  1. Destination url? how do I find it or what is it? Tried reading but don’t understand
    - https://a.klaviyo.com/api/track
     
  2. Header? what to write?
  • Content-Type": "application/json"
  1. The business public api or make a private api?-
  • I would go with the public API. 
  1. 4. Change the "token" in the json body?
  • { "token": "YOUR_PUBLIC_API_KEY", "properties": { "$email": "{{ person.email }}", "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|add:'2' }}" } }
  1. If i want to remove points from the value, what word do I replace the “add” with?
  • You could try with this function: "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|subtract:'2' }}"

Hope that helps! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 3 replies
  • November 11, 2024
Christiannoerbjerg wrote:

Hi @

Thank you for posting in the Community!

You could try the following: 

  1. Destination url? how do I find it or what is it? Tried reading but don’t understand
    - https://a.klaviyo.com/api/track
     
  2. Header? what to write?
  • Content-Type": "application/json"
  1. The business public api or make a private api?-
  • I would go with the public API. 
  1. 4. Change the "token" in the json body?
  • { "token": "YOUR_PUBLIC_API_KEY", "properties": { "$email": "{{ person.email }}", "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|add:'2' }}" } }
  1. If i want to remove points from the value, what word do I replace the “add” with?
  • You could try with this function: "Lead_Score": "{{ person|lookup:'Lead_Score'|default:0|subtract:'2' }}"

Hope that helps! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov

 

“This Klaviyo endpoint is retiring”
Tried with https://a.klaviyo.com/api/events/ instead.

Tried that header and Json body and got a 401 error message..


DavidSandel
Partner - Silver
Forum|alt.badge.img+21
  • Partner - Silver
  • 155 replies
  • November 21, 2024

@eligus1 - As I mentioned in the very first reply...2 weeks ago….which contains everything you’re asking….

 

You need the create or update profile endpoint:

The headers are also listed in plain sight at the top of the page in their payload example:

  • Authorization: Klaviyo-API-Key XXXXXXXXXXX
  • accept: application/vnd.api+json
  • content-type: application/vnd.api+json
  • revision: 2024-10-15

This is going through their PUBLIC API, but you need to provide your private API key from your account settings. This is not a private app.