Skip to main content

Hi 🙂 My goal is to get SMS consent after subscription of a Klaviyo signup form. I want to use Zapier since Klaviyo do not sent OPT-IN to europe contries. 

I have followed this guide: 
https://help.klaviyo.com/hc/en-us/articles/4407486310683-How-to-Send-Consent-to-Klaviyo-via-Zapier

When testing the code in Zapier no errors happens. However inside Klaviyo the profiles do not get marked with SMS-consent. Do any of you guys know any common issues and a fix? :-) 

Underneath you can see a screenshot of my code in Zapier:


Heres the code: 

import requests

url = "https://a.klaviyo.com/api/v2/list/WXxhcB/subscribe"
querystring = {"api_key":"pk_fd3964481165b5fd3ee112dafea8f7dd7b"}

# configuring sms_consent mapping to boolean value
if (input_datad"sms_consent"] == "true" or input_datad"sms_consent"] == "True" or input_datad"sms_consent"] == "TRUE"):
sms_consent = True
elif (input_datad"sms_consent"] == "false" or input_datad"sms_consent"] == "False" or input_datad"sms_consent"] == "FALSE"):
sms_consent = False

payload = {"profiles": s
{"email": input_datad"email"], "phone_number": input_datad"phone_number"], "sms_consent": input_datad"sms_consent"]}
]}
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers, params=querystring)

# Zapier requires an 'output' object
output = {"response text": response.text}

Best regards
Lasse, Lykke by Lykke

Hi there @lykkebylykke ,

Unfortunately, passing SMS Consent with Zapier into Klaviyo is not possible at this time. It would need to be done through an API call. We would recommend working with a developer or if you yourself are a developer, then we would recommend reviewing this section of the doc to understand how to subscribe & pass SMS consent in your API request:https://apidocs.klaviyo.com/reference/lists-segments#subscribe
 
If you do not have access to a developer, then please consider our robust community of partner agencies to assist with this. You can browse our Klaviyo Agency Directory to decide which option is best suited for you.


@alex.hong Why are you saying passing SMS consent with Zapier is not possible considering the Zapier support article that @lykkebylykke linked to? According to this support doc it is.  

https://help.klaviyo.com/hc/en-us/articles/4407486310683-How-to-send-consent-to-Klaviyo-via-Zapier

Right now I’m experiencing an issue were SMS consent is being sent to Klaviyo from Zapier, but email consent is not. I’m troubleshooting but confused why you said that. 


Hi @addison

 

Adding SMS consent via Zapier is a relatively new feature, which in the past would constitute an API integration. I see that you managed to solve this issue in your other thread here, so I’m going to post it below so others in the Community can follow along if they run into the same issue:

 

Thanks so much for sharing your resolution with the Community!

- Brian


Reply