skip to Main Content

I am using Twillio API in my node application (API) to send users an OTP, when they try to login through their mobile number. It’s fine, but the code length is six numbers and I want to create a code of five o four numbers. My questions is Can I customize the code length from API node code? I mean, in the code I can customize? Or I must to customize the code length from the account on twilio? Somebody knows? I need help. Please, I searched in internet and in the document but I didn’t find any answers.

2

Answers


  1. Yes You can customize length of OTP from your Twillio account.

    Login your twilio account.
    go to your otp verification service.You will find 
    CODE LENGTH property over there. Set length whatever you want and save service.
    
    

    Hope it helps.

    Login or Signup to reply.
  2. Add codeLength key while creating twilio service

    client.verify.v2.services.create({ friendlyName: "App", codeLength: 4 });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search