Crear un fragmento de plantilla

Un fragmento de plantilla es el contenido de la plantilla, identificado unívocamente por su canal y configuración regional. Para crear un fragmento deberá haber creado una plantilla.

ClaveDescripción
VONAGE_APPLICATION_ID

The Vonage Application ID.

VONAGE_APPLICATION_PRIVATE_KEY_PATH

Private key path.

JWT

Used to authenticate your request. See Authentication for more information, including how to generate a JWT.

TEMPLATE_ID

The custom template ID

Escriba el código

Añada lo siguiente a create-template-fragment.sh:

curl -X POST "https://api.nexmo.com/v2/verify/templates/$VERIFY_TEMPLATE_ID/template_fragments" \
  -H "Authorization: Bearer $JWT"\
  -H 'Content-Type: application/json' \
  -d $'{
	  "channel": "sms",
    "locale": "en-us",
    "text": "The authentication code for your ${brand} is: ${code}"
  }'

Ver fuente completa

Ejecute su código

Guarde este archivo en su máquina y ejecútelo:

sh create-template-fragment.sh