Skip to main content
Solved

Attempting to use Legacy Form submission for SMS signup

  • May 5, 2022
  • 1 reply
  • 250 views

Forum|alt.badge.img+2

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.)

 

Best answer by Dov

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.

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • 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.