Menu

Expand
Rate this page:

whatsapp/authentication

WhatsApp/authentication templates let companies deliver WA approved one-time-password button. Unlike other templates the body is preset by WhatsApp. Some modifications can be made by specifying certain parameters however custom authentication templates are not allowed.

  • When sending whatsapp/authentication templates a single variable must be defined at send time and set to the one time passcode.
  • whatsapp/authentication templates must be approved by WhatsApp to send to customers.

Supported Channels

WhatsApp

Message Preview

Copycode

Data Parameters

add_security_recommendation:

Type - boolean

Required - no

Variable Support - no

Description - Optional field to add the message "For your security, do not share this code" or the translated language's equivalent. This field defaults to TRUE.

code_expiration_minutes:

Type - integer

Required - no

Variable Support - no

Description - The amount of time you want to inform the customer that the one time passcode is available for. Adds a footer message stating "This code expires in x minutes" where x is the number specified.

  • One whole numbers from 1-90 is allowed

actions:

Type - array[actions]

Required - yes

Variable Support - See Common Components: Actions definition

Description - Buttons that recipients can tap on to act on the message:

  • Type must be specified as COPY_CODE.
  • copy_code_text must be specified as a string less than 25 characters long.
Loading Code Sample...
        
        

        Create WA OTP Button Template

        Send WA Authentication Templates Created with Content Templates

        Authentication templates are slightly different from other content types in that the body field is preset and there is a pre-existing content variable.

        To send these templates you will need to send them as usual but include a content variable containing the OTP code you would like to send.

        The OTP code that you send must be less than 15 characters long.

        --data-urlencode "ContentVariables={"1": "12345"}" \
        
        Loading Code Sample...
              
              

              Sending WA Authentication Templates

              Rate this page:

              Need some help?

              We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

              Loading Code Sample...
                    
                    
                    

                    Thank you for your feedback!

                    Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                    Sending your feedback...
                    🎉 Thank you for your feedback!
                    Something went wrong. Please try again.

                    Thanks for your feedback!

                    thanks-feedback-gif