Templates
Verify Templates are in Beta!
This Verify feature is currently in the Beta maturity stage, which means that:
1. We're actively looking for early-adopter customers to try it out and give feedback. That could be you!
2. You'll need to contact sales to request access to the API.
Lastly, please note that templates are only supported with the SMS channel.
Templates are predefined and approved texts used to send a SMS Verification. Templates allow you to customize the text you send for verification.
Template types include:
パブリック | Available for all Verify customers. More information and a list of public template text options found here. |
プライベート | Available on a case by case basis per customer. Please get in touch if one of our public templates does not suit your business need. |
An account can have multiple public and private templates associated with it to accomodate various use cases like:
- user authentication
- account validation
- password reset
- ...and more!
Template translations and supported languages
The template message body can be translated to various languages with the locale
parameter. Learn more about support languages here.
Template properties
Resource Properties in REST API format | |
---|---|
sid
|
A 34 character string that uniquely identifies a Verification Template. |
account_sid
|
The unique SID identifier of the Account. |
friendly_name
|
A descriptive string that you create to describe a Template. |
translations
|
An object that contains the different translations of the template. Every translation is identified by the language short name and contains it respective information as the approval status, text and created/modified date. |
Get a list of available templates
https://verify.twilio.com/v2/Templates
パラメーター
Parameters in REST API format | |
---|---|
friendly_name
オプション
|
String filter used to query templates with a given friendly name |
例 1
Template priority
The message template used for an SMS verification is defined with the following priority order:
- A
TemplateSid
provided in the create Verification request. - A
DefaultTemplateSid
set for the Verify Service. - The Verify API default template text. In English that looks like:
Your {Service Friendly Name} verification code is: 511198
Start a Verification with a specific template
To send a verification with a specified template, include the TemplateSid (starts with HJ) as a parameter.
例 2
Add a default template to a Verification Service
You can also define a default message template for a Service that will be used for all SMS verifications (unless you explicitly override it).
The DefaultTemplateSid
attribute of the service can be set both when the Service is created or when the Service is updated.
例 3
例 4
If neither a TemplateSid
is provided when starting a new Verification nor a DefaultTemplateSid
attribute is set for the Service, the Verification will use the default translation for that template.
More details on how to start a Verification can be found in the Verification documentation.
Domain-bound codes
Use templates to support SMS domain-bound codes with the WebOTP API. You will need a custom template to support this use case, so reach out for access and our team can set it up.
123456 is your Example code.
@example.com #123456
ヘルプが必要ですか?
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.