Closed venu-prasanna-tw closed 2 years ago
This is not a change that can be made in the library. Please file a support ticket to inquire about adding this feature to the API.
Hi @childish-sambino , as per the API defined here https://www.twilio.com/docs/verify/api/service#create-a-verification-service, verify service do support CodeLength
parameter.
I can even see CodeLength
option available in verify.V2.CreateServiceParams
but none of the public facing API supports this.
@kpritam Ah. I see that code length is available when creating the service but not when creating the message. This param is mentioned in the docs you link and as part of the create service params. What docs do you think are needed?
@childish-sambino So I am using verify api and I want to set code digit length programmatically. I looked at all the Verify APIs and couldn't not find a way to programmatically set code length
I have the following questions:
import (
"fmt"
"github.com/twilio/twilio-go"
verify "github.com/twilio/twilio-go/rest/verify/v2"
)
func main() { twilioClient := twilio.NewRestClient()
verifyServiceParams := &verify.CreateServiceParams{}
verifyServiceParams.SetFriendlyName("Service with Code Length 10")
verifyServiceParams.SetCodeLength(10)
resp, err := twilioClient.VerifyV2.CreateService(verifyServiceParams)
if err != nil {
fmt.Println(err)
} else {
fmt.Println(*resp.Sid)
}
}
Closing due to inactivity. Please re-open this issue or open a new GitHub issue if you still need help.
Issue Summary
I am using https://github.com/twilio/twilio-go/tree/main/rest/verify/v2 library to send OTP code. But I wanted to change the OTP code length and I don't see any option in CreateMessage that will accept the OtpCode length.
Technical details: