My Input Request JSON looks like this below:
{
"phoneNumbers": [{
"phoneNumberType": "mobile",
"phoneNumber": "54112724555"
},
{
"phoneNumberType": "mobile",
"phoneNumber": "16298765432"
}
]
}
I want to generate Output Json Like this :
{
"phoneNumbers": [{
"phoneNumberType": "mobile",
"phoneNumber": "54112724555",
"CountryCode": "ARG"
},
{
"phoneNumberType": "mobile",
"phoneNumber": "16298765432",
"CountryCode": "US"
}
]
}
I derive the countryCode from the PhoneNumber using callingCode and CountryCode Mapping given in csv file.
CALLING_CODE,COUNTRY_CODE
1,US
7,RU
54,AR
20,EG
32,BE
33,FR
505,NI
506,CR
1876,JM
1905,CA
1939,PR
262262,RE
262269,YT
.,.
.,.
I have used the fileConnector to read the CSV File and stored it in Vars.CallingCodeMapping.
I have to do lookup phoneNumber with calling code by passing first letter from the phonenumber matching return countryCode then first two letter ....firstsixLetter if nothing matches return NA.