The selected template has one or more expected substitutions that were not provided in the request.
TemplateCustomSubstitution
parameter.For example, the following template requires a uuid
substitution:
"Your {{friendly_name}} login link: https://example.com/verify.html?uuid={{uuid}}&code={{code}}"
The expected request in cURL:
1curl -X POST https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications \2--data-urlencode "To=+15017122661" \3--data-urlencode "Channel=sms" \4--data-urlencode "TemplateSid=HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \5--data-urlencode "TemplateCustomSubstitutions={ \"uuid\": \"MY_UNIQUE_ID\" }" \6-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
The expected request in Node.js:
1const verification = await client.verify.v22.services("VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")3.verifications.create({4channel: "sms",5templateSid: "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",6to: "+15017122661",7templateCustomSubstitutions: '{ "uuid": "MY_UNIQUE_ID" }'8});
The following variables are auto-populated by Twilio and do not need to be included in your request:
{{friendly_name}}
{{code}}
{{ttl}}