Hi, Im trying to use the new API to check for the existence of a profile before creating a new one. (I miss the old way of it automatically updating existing profiles if they already existed when adding to a list). I’ve tried invoking the profiles endpoint from curl and python without success. The following is an example generated from the documentation:
import requests
url = "https://a.klaviyo.com/api/profiles/?fields[profile]=email&filter=testuser"
headers = {
"accept": "application/json",
"revision": "2023-01-24",
"Authorization": "Klaviyo-API-Key MY_PRIVATE_KEY_HERE"
}
response = requests.get(url, headers=headers)
print(response.text)
It doesn't matter what field I choose for the profile whether phone number, first name, etc. The result is always:
{"errors":[{"id":"54d8f624-127d-48db-b568-cfb3d6abeb1b","status":400,"code":"invalid","title":"Invalid input.","detail":"Invalid filter provided.","source":{"parameter":"filter"},"meta":{}}]}
Thanks for any guidance.