First of all, you will need to integrate NumVerify API card to your ChatBot. For this, you will access the following URL: numverify API | Free Phone Number Validation & Lookup API.
Step 1: You will create an account on the NumVerify website or Sign in (if the account is created already) with your account.
Step 2: Upon successful login, dashboard will appear and API access key will be generated by the system and you will validate the US number.
Step 3: You will perform the following actions:
- Enter Phone Number – Phone number should not include country code
- Select Country Code – Country code will be selected in this step
- Enter Format JSON – By default it is 1 (no need to change)
- Click Run to validate the number
Once we run the call a new tab will be opened in the browser. Showing the URL and the JSON response.
Step 4: You will copy the URL and open your Chatbot from Botco interface.
Step 5: Open your desired form, here we will open Test_Form1 and the respective interface will appear.
Step 6: Enter the question “What is your phone number?” and click on Add Question to add the question.
Step 7: Upon adding the question, click on Next to proceed.
Step 8: Here, perform the following steps:
- Expected Response (Entity) – select @sys.any
- Attribute - Mel_Num_to_verify
- Continue to – select Block and enter testapi_ABC (This block name should be created beforehand at Block Groups section)
- Click on Done
Step 9: Click Save to save the form details.
Step 10: Now you will add API Card.
First go to the testapi_ABC empty block, select API in Collect Data section.
Step 11: Add API details in the following screen.
Step 12: Here, perform the following steps:
- API ID – select PhoneNumLookup
- API Method – select Get
- API URL – paste the copied URL “net/api/validate?access_key=225b6d83399ed3ed06aa1634f25b7986&number=::numxyz::&country_code=US&format=1” from Step 4.
- Click Add parameter
- Parameter Name - ::numxyz::
- Value – Mel_Num_to_verify
- Select Set Attribute
- Click Add Attribute
- Attribute Name – true_false
- JSON Path – $.valid
- Click Save
Step 13: Add Text card and enter your # is : {{true_false}} (If you like, you can cancel this text if there is no need to show the response to the user).
Step 14: Add Go To Card:
- Rule – true_false
- is true – thank_you
- is false – re-enter
Step 15: re_enter block should be created to forward the user to the form again for a new call & validation.
Step 16: Launch your chatbot and here you go! your chatbot can now validate US numbers.