How to automatically read OTP using API in Selenium | Automation of OTP in RPA

Advertisement

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.

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.

Advertisement

Copy this bucket id from here.

Step 3: Setup rule in IFTTT

  1. Create an account in ifttt.com
  2. Create a new applet
  3. If this….. click on Android SMS trigger
  4. Select “New SMS received matches search” and use {yourkeyword} eg. OTP as the search key
  5. Then… Choose a service named Webhooks and then select “Make a web request”
  6. Paste the URL: https://kvdb.io/<bucket>/99XXXXXXXX replace 99XXXXXXXX with your phone number and <bucket> with bucket id created in step second.
  7. Method is PUT
  8. Content-Type PlainText
  9. 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.

Advertisement

Leave a Reply

Your email address will not be published. Required fields are marked *

three × 2 =

Share on Social Media