Skip to main content

Hello everybody,

 

I’m integrating a popup for newsletter susbscription on a Prestashop website and I want to send the email registered to the API “list subscription”.

I already have an hook which is call after a newsletter subscription and call the “subscribeCustomer” function of the KlaviyoApiWrapper class with params: “email” => customer@mail.com and ‘customerProperties’ => r]

 

The function is succefully called, but the problem is on API call I think, on “subscribeMemberToList” function, i have a request to:

url: https://a.klaviyo.com/api/v2/list/(my_list_id)/subscribe

with this body: 

{

    "profiles":p

        {

            "email":"exemple@mymail.com",

            "$phone_number":null,

            "$first_name":null,

            "$last_name":null,

            "$source":"PrestaShop",

            "$consent":l

                "email"

                ]

        }

    ]

}

 

And the request return an empty response with the status code 200 (success), but nothing is add on my list. I already tried to change the body on postman but i have the same problem:

 

{

    "profiles":0

        {

            "email":"exemple@mymail.com"

        }

    ]

}

 

someone have an idea ?

 

Thanks in advance,

Julien

@JulienLdt What are you getting back as a response aside from the 200 status code? Are you getting back an empty array? If the list is set to double opt-in, the profile won’t be added until they confirm via the confirmation email. If the response is an empty array then that is what is happening.

 

You can try making a request for an email that you have access to so you can see if you are getting the double opt-in email and once you confirm, see if you get added to the list.


Hello @jallain,

it was that. I’m not used to Klaviyo it was a mistake from my part..

Thank you for your help and have a good day ! 


@JulienLdt That’s great! Happy we could work through that together. Feel free to mark my last message as the solution in case other users encounter the same issue!


Reply