Adding Additional Phones via API not Working

Hi. I am trying to pass this into the API: {"phones": {"additionalPhones": ["123", "456", "789"]}}, but instead of adding the numbers, it is actually only deleting previous values and not adding the new ones. How so? I am sticking to the DIN 5008 format (e.g. +49 151 123456789).
4 Replies
Prastoin
Prastoin3mo ago
Hey, about to share an example
martmull
martmull3mo ago
for phones, you need to pass a dictionnary for each additional phone with this shape
{
"phones": {
"primaryPhoneNumber": "06 10 20 30 40",
"primaryPhoneCountryCode": "FR",
"primaryPhoneCallingCode": "+33",
"additionalPhones": [
{ "number": "06 10 20 30 41", "countryCode": "GB", "callingCode": "+44"}
]
}
{
"phones": {
"primaryPhoneNumber": "06 10 20 30 40",
"primaryPhoneCountryCode": "FR",
"primaryPhoneCallingCode": "+33",
"additionalPhones": [
{ "number": "06 10 20 30 41", "countryCode": "GB", "callingCode": "+44"}
]
}
Prastoin
Prastoin3mo ago
Please note that if you send primary number only without any country calling code it will try to infer the informations
input: { primaryPhoneNumber: '+33123456789' },
expected: {
primaryPhoneNumber: '123456789',
primaryPhoneCountryCode: 'FR',
primaryPhoneCallingCode: '+33',
additionalPhones: null,
},
input: { primaryPhoneNumber: '+33123456789' },
expected: {
primaryPhoneNumber: '123456789',
primaryPhoneCountryCode: 'FR',
primaryPhoneCallingCode: '+33',
additionalPhones: null,
},
Same for additional phones and number I would still recommend explicitly passing the country code as some calling code are shared ( +1 is CANADA and US for instance )
BigKahuna
BigKahunaOP3mo ago
@kapa

Did you find this page helpful?