Hello,
I set up a form to subscribe users to a list. I use the API for that. It works when i only add the email to the payload, using the https://a.klaviyo.com/api/v2/list/LIST_ID/subscribe?api_key=API_KEY endpoint.
I closely follow the docs, using Guzzle (PHP)
But when i try to add a first name to the profile, it doesn”t seem to work.
- Using the list → subscribe endpoint, i don’t know if it’s possible, and if it is, the expected body request (the one working with the email looks like this :
'body' => '{"profiles":[{"email":"' . $email . '"}]}'
- Using the identify endpoint (POST), the request returns 1, but no firstname is added to the profile
'data' => '{"token":"MYPUBLICKEY","properties": {"$email": "THEEMAIL", "$first_name":"THEFIRSTNAME"}}'
- Using the list → members endpoint, i get a 400 Bad Request as soon as i deviate from the base body request with email AND phone number
'body' => '{"profiles":[{"email":"THEEMAIL"},{"first_name":"THEFIRSTNAME"}]}'
Can you please help me with that issue ?
Thanks !