Solved

Getting invalid phone number - For Update List API


Badge +1

We followed this link to check for the valid phone number formats : https://help.klaviyo.com/hc/en-us/articles/360046055671-Accepted-Phone-Number-Formats-for-SMS-in-Klaviyo

While updating the profiles from the Update list api ( URL: {{baseUrl}}/v2/list/:list_id/members)

But few of the formats aren’t working correctly. PFB the respective request body.

Working correctly for below Request Body:

{

"profiles": [{ "country":"USA","phone_number":"+12345678900" }]

}

 

Not working for below:

{

"profiles": [{ "country":"USA","phone_number":"2345678900" }]

}

&

{

"profiles": [{ "country":"US","phone_number":"2345678900" }]

}

 

Error Response:

{

"detail": "+2345678900 is not a valid phone number."

}

icon

Best answer by alex.hong 24 May 2022, 20:40

View original

3 replies

Userlevel 7
Badge +58

Hi there @pranjal.thakur,

Welcome to the Community.

If you are trying to submit a phone number that is available for SMS messaging it has to be in E.164 format that starts with "+1" then the rest of the US phone number.  You can see an example in our API documents.

You can also use Klaviyo's v2 List API to collect SMS consent. This is particularly helpful if you want to, for example, integrate a non-Klaviyo signup form to gather consented phone numbers for SMS marketing. For details on how to leverage APIs for SMS, check out our List API documentation

Thanks,

Alex
 

Badge

Hi there @pranjal.thakur,

Welcome to the Community.

If you are trying to submit a phone number that is available for SMS messaging it has to be in E.164 format that starts with "+1" then the rest of the US phone number.  You can see an example in our API documents.

You can also use Klaviyo's v2 List API to collect SMS consent. This is particularly helpful if you want to, for example, integrate a non-Klaviyo signup form to gather consented phone numbers for SMS marketing. For details on how to leverage APIs for SMS, check out our List API documentation

Thanks,

Alex
 

What about the case of when you do not want to submit the phone number that is available for sms messaging. What if i just want to submit a 10 digit phone number without any country code. Are you telling me that is not an option?

 

Please emphasize.

Userlevel 7
Badge +58

Hi there @timbogdanov,

Thanks for asking. Quick question, what is the objective of submitting numbers that cannot be used for SMS into a profile? If you wanted to attach a number, you could add it as part of a CSV upload to update profile properties.

Reply