Verify Phone In Salesforce Using Veriphone API
Verified phones hold a great significance for various business use cases and that is the reason why businesses lays emphasis on verify phone using veriphone API. It helps businesses to identify their valid customers and extend services efficiently.
Advantages of verifying phone numbers
There can be many reasons as to why a business goes for phone verification, out of which a few are mentioned below-
Better service: It becomes easy for a business to send service related messages to the phones that are verified.
Identify fake users: Phone verification helps a business to identify fake profiles and thus deactivating them.
Ease of use: Phone verification makes the business process easy by allowing convenient verification, updates and much more.
Verify phone using salesforce APIs
It is easy for the tech experts to validate a phone number via. normalize expression; however, chances are that system will not play a supporting role for the verification of the number.
Hence, organizations often resort to API’s dedicated for verification of mobile numbers. Out of many API’s available in the market, below is the list of the most popular ones-
- Twilio
- Veriphone
- Telesign
- Nexmo
It is at your discretion what API to use. However this article focuses on using Veriphone for the verification of phone numbers.
Implication
We need to verify the object’s mobile number. Here, the customer’s information is being stored by the account object.
Resolution
There can be two methods to verify account records-
- Batch processing to verify all records in bulk
- Manual verification
Manual verification covers the entire process in 4 simple steps that are mentioned below. Ensure that you do not miss any of it.
A. Veriphone API Integration
First, create an account on Veriphone. After you successfully create and verify the account, copy the API key that can be found on the setting section of the dashboard.
Use the API key to call Veriphone api. To call this API, you need to create a basic Apex class.Use GET/POST call to make use of API. The GET method that has been used in this tutorial is an easy way that demands only the country code and the API key.
Apex Class:
B. Flow Creation
Use the InvocableMethod to call the class method as described above for the successful verification.
Below is the code to create controller class that will be needed to call phone service class-
Now is the time to create a flow that will help in calling this method.
Flow: Screen Flow
Utilities: Get, Update, Decision, Screen, Action and Assignment
Steps-
- Create a variable.
Variable- recordld
- Retrieve account record by using Get element. Return PhoneVerified field, i.e. is a custom field that stores verification status.
- Add another element, i.e. Action. Use action Verify Phone.
- Transfer record phone field to method.
- Add another variable that will help to store response retrieved from the action call.
- Now, use the decision element to verify the value followed by Update element for record updation.
C. Add button
Next step is all about adding a button on the page layout that will help in verification of the phone in Salesforce. This demands to create a new action button that is capable of calling above flow via that button.
After creating this button, add the button on the page layout via ‘Salesforce Mobile and Lightning Experience Actions’ section.
Wrap up
After sequentially following the steps that are mentioned in this article, you will now be able to verify phone using veriphone API.