Skip to main content
Contributor I
May 5, 2022
Solved

Attempting to use Legacy Form submission for SMS signup

I’ve looked at both 

and

 

Neither seem to be the issue that I’m facing.

 

I’m trying to use the legacy AJAX system to submit a signup for SMS since our site is headless.

I’ve had this successfully working with emails without a problem, the submission to the list ID returns a confirmation. However, when I submit with just a `phone_number` it responds with `is_subscribed` without any other details (which would happen when I was setting up the email and submitted it empty as well)

Am I missing a key name? or is it not possible to use AJAX to sign up for sms?

The phone number is a valid phone number and I’ve used several different formats (##########, 1##########, ###-###-####, +1##########, etc.)

 

This topic has been closed for replies.
Dov
DovAnswer
Klaviyo Alum
May 6, 2022

Hi @sjstark,

Thanks for sharing your question with us.

If you have a look at our documentation here, the “email” field is required in a POST request using AJAX. So in short, yes you cannot subscribe to SMS using that endpoint. That endpoint will only work for email, you can just pass phone number as a custom property if you wish. In order to subscribe to SMS, you’d have to use the V2 subscribe endpoint and meet the pre-requisites outlined here.

I hope that’s helpful and thanks for being a community member.

DD

1 reply

Dov
DovAnswer
Klaviyo Alum
May 6, 2022

Hi @sjstark,

Thanks for sharing your question with us.

If you have a look at our documentation here, the “email” field is required in a POST request using AJAX. So in short, yes you cannot subscribe to SMS using that endpoint. That endpoint will only work for email, you can just pass phone number as a custom property if you wish. In order to subscribe to SMS, you’d have to use the V2 subscribe endpoint and meet the pre-requisites outlined here.

I hope that’s helpful and thanks for being a community member.

DD