v1

latestOpenAPI 3.0.12026-07-2471135326.0 KB
Two Factor Authentication

Create Code Generator

This endpoint allows you to create a Code Generator to configure the number of characters of the security code (<code>codeLength</code>), expiration time of the code in minutes (<code>expirationMinutes</code>), the delivery channel where the code will be sent (SMS or Email) and the message body with the code placeholder that is sent to end users (<code>text</code>).If you want to send the code by SMS channel, you need to provide a specific sender (<code>shortcode</code>) to be user on an SMS messange sent to the end user.In case of sending the code by Email channel, you need to provide a specific sender (<code>from</code>) to be used on an Email message sent to the end user.Note: You must be registered in a delivery channel from which the message will be sent to get a valid short code (SMS) or a valid email sender.

post/v1/2fa

Request body

codeLengthinteger required

character length to generate codes

expirationMinutesinteger required

minutes to expire a code

Example request

{
  "codeLength": 6,
  "expirationMinutes": 10,
  "channels": [
    {
      "type": "SMS",
      "shortcode": "1234",
      "message": "your verification code is {0}"
    },
    {
      "type": "EMAIL",
      "from": "noreply@domain.com",
      "subject": "Verification code",
      "message": "your verification code is {0}"
    },
    {
      "type": "WHATSAPP",
      "address": "1234",
      "message": "Your verification code is {{0}}",
      "templateName": "template_name",
      "templateNamespace": "f6ede725_6be8_45ea_ac8b_ed3c57cb0d12"
    }
  ]
}

Response

2FA Interaction Created

Example response

{
  "meta": {
    "timestamp": 1597166699457,
    "transactionId": "70169d77-c165-4795-9932-35b8a3af96fb",
    "explain": "a descriptive text"
  },
  "data": {
    "id": 1,
    "codeLength": 5,
    "expirationMinutes": 10,
    "channels": [
      {
        "subject": "Your verification code",
        "shortcode": "1234",
        "from": "noreply@example.com",
        "text": "Verification code: {0}",
        "placeholder": "code",
        "address": "1234",
        "templateName": "2fa_template",
        "templateId": "2fa_template",
        "templateLanguage": "en",
        "type": "SMS"
      }
    ]
  }
}