Skip to main content
Problem Solver I
January 22, 2021
Solved

How can I export person_id by using their email address?

  • January 22, 2021
  • 20 replies
  • 2456 views

I am attempting to isolate the PERSON_ID from accounts by using their email address.

I can get a ‘1’ response from Identify request, but I cannot see the data in the profile

I can see profile data when I use the Profiles API with a known PERSON_ID

 

Essentially, I have a known email address and I want to view the data within that profile.

This topic has been closed for replies.
Best answer by jallain

Hello @dlshaw9 , if you have a customer’s email address and would like to get their Klaviyo profile ID you can use this URL: 

https://a.klaviyo.com/api/v2/people/search?api_key=API_KEY_HERE&email=EMAIL_HERE

 

You can then use the profile ID that gets returned to update the profile. Hope that helps.

20 replies

jallain
Klaviyo Employee
jallainAnswer
Klaviyo Employee
January 22, 2021

Hello @dlshaw9 , if you have a customer’s email address and would like to get their Klaviyo profile ID you can use this URL: 

https://a.klaviyo.com/api/v2/people/search?api_key=API_KEY_HERE&email=EMAIL_HERE

 

You can then use the profile ID that gets returned to update the profile. Hope that helps.

dlshaw9Author
Problem Solver I
January 22, 2021

Thank you, Jallain! That did exactly the trick

I am now trying to pass a variable into:

GET https://a.klaviyo.com/api/v1/person/{{ PERSON_ID }}

I keep getting 404 NOT FOUND response codes

This is my formatted URL

GET https://a.klaviyo.com/api/v1/person/{ticket.requester.integrations[83684].id}?api_key=XXXXXX

I believe this to be a GORGIAS issue, but any insight into what might be causing the problem from the klaviyo url standpoint?

jallain
Klaviyo Employee
Klaviyo Employee
January 22, 2021

@dlshaw9 it sounds like the request is working but the PERSON_ID you are providing is not one that exists in your Klaviyo account. Are you using the ID of the profile from Klaviyo or the ID from something else?

dlshaw9Author
Problem Solver I
January 22, 2021

@dlshaw9 it sounds like the request is working but the PERSON_ID you are providing is not one that exists in your Klaviyo account. Are you using the ID of the profile from Klaviyo or the ID from something else?

The data in the GORGIAS import matches the ID in Klaviyo -- I  must just not be pulling the variable address correctly

 

jallain
Klaviyo Employee
Klaviyo Employee
January 22, 2021

@dlshaw9 are you using the Klaviyo public API key or the Klaviyo private API key in your request? Make sure to use the private API key which begins with pk_

dlshaw9Author
Problem Solver I
January 22, 2021

I removed a bit of my censoring:

GET https://a.klaviyo.com/api/v1/person/{ticket.requester.integrations[83684].id}?api_key=pk_4fXXXXXX

 

jallain
Klaviyo Employee
Klaviyo Employee
January 22, 2021

@dlshaw9 are you able to log the variable to ensure that it is the correct profile ID? Your request URL looks correctly structured and you are getting a response from the API so perhaps the ID is getting pulled incorrectly somehow?

dlshaw9Author
Problem Solver I
January 22, 2021

That has to be the issue

 

Is a single set of curly brackets the correct syntax to pass that variable (it doesn’t trigger at all with double curlies)?

dlshaw9Author
Problem Solver I
January 22, 2021

OK so I have confirmed via the Gorgias Macro tool that the variable pulls the right data -- for some reason it does not convert to a string when it passes the url

jallain
Klaviyo Employee
Klaviyo Employee
January 22, 2021

@dlshaw9 There should not be any curly braces in the actual request itself. The URL should look like this:

https://a.klaviyo.com/api/v1/person/AAAAA?api_key=pk_AAAAA

 

Replacing AAAAA with the correct value.