How to automatically read OTP using API in Selenium | Automation of OTP in RPA
How to read SMS OTP automatically? Nowadays every website is secured with OTP, but when you have to automate using Python, Java, or Selenium programming, OTP is also a key to the success of complete automation.
Table of Contents
Step 1: Download IFTTT From PlayStore or AppStore
If This Then That is a service that allows a user to program a response to events in the world of various kinds. There is a long list of kinds of events to which IFTTT can respond, all detectable via the Internet. An example event is that Weather Underground reports rain is forecast for tomorrow.
PlayStore: https://play.google.com/store/apps/details?id=com.ifttt.ifttt&hl=en_IN&gl=US
AppStore: https://apps.apple.com/in/app/ifttt/id660944635
Step 2: Create an account on kvdb.io
kvdb.io is a free key-value pair database, gives api to read and set values.
Click on Get Started to create a bucket.
After creating the bucket, you will see screen like this, by default you get unsecured bucket, you can change this setting by creating api key in case you want to make it private.
Copy this bucket id from here.
Step 3: Setup rule in IFTTT
- Create an account in ifttt.com
- Create a new applet
- If this….. click on Android SMS trigger
- Select “New SMS received matches search” and use {yourkeyword} eg. OTP as the search key
- Then… Choose a service named Webhooks and then select “Make a web request”
- Paste the URL: https://kvdb.io/<bucket>/99XXXXXXXX replace 99XXXXXXXX with your phone number and <bucket> with bucket id created in step second.
- Method is PUT
- Content-Type PlainText
- Body: Add ingredient and select Text
Step 4: Make sure you enable background running permission
Step 5:
Not to get the OTP via api, you can request GET for the same url which we did setup in setup 3.