6. Add/Edit a language template

You can add or edit a language template by referring to the application UUID resource and the language you want to add or edit. If you specify also the channel optional parameter, the specific template for this delivery channel will be created.

curl \
-X POST "https://api.tyntec.com/2fa/v1/application/e1f7b288-3f05-4ea6-838c-dac09eb25252/language?language=de&text=OTP-Code%3A%20%7B%7BOTP%7D%7D%20Einen%20sch%C3%B6nen%20Tag%20noch.%20OTP-Code%3A%20%7B%7BOTP%7D%7D&channel=VOICE" \
-H  "accept: application/json" \
-H  "apiKey: yourApiKey"

* 2a9a2a1f-ad49-39e4-9a0e-8f2b648ebf83 is the uuid of the specific application for this example.

* text parameter should be URL encoded

 

Parameter

Optional/ Mandatory

Possible Values

Description

applicationId

mandatory

The applicationId of the application you would like to edit

This parameter is part of the URI following the pattern

${baseURL}/application/{applicaitonId}

You can specify "default" to reference the default application

language

mandatory

String

The language locale should be in ISO 639-1 format https://en.wikipedia.org/wiki/ISO_639-1

text

mandatory

String

The text template for the specific language. Placeholder {{OTP}} must exist at least once.

{{SEC}} is an optional placeholder that will replace the “expire” parameter for this application.

channel

optional

Enum. Possible values:

  • SMS
  • VOICE

The optional parameter is set in case you want for the same language to have different template depending on the delivery channel.

 

Response to Basic Example for add/edit application language template (JSON)

HTTP/1.1 200 OK

{
  "accountId": "yourAccountId",
  "applicationId": "e1f7b288-3f05-4ea6-838c-dac09eb25252",
  "name": "My web app 2",
  "pinLength": 6,
  "alphanumeric": false,
  "attempts": 5,
  "expire": 1000,
  "template": {
    "de": "OTP-Code: {{OTP}} Einen schönen Tag noch",
    "en": "OTP code: {{OTP}}. Valid for {{SEC}} seconds.",
    "de-voice": "OTP-Code: {{OTP}} Einen schönen Tag noch. OTP-Code: {{OTP}}"
  },
  "sender": "Tyntec",
  "created": 1499245230960
}