Denna slutpunkt låter er implementera tvåfaktorsautentisering, på det enkla viset, genom att skicka ett sms med OTP.
POST `https://api.nomado.eu/2fa/create`
Du kan välja en av autentiseringsmetoderna härifrån.
Det JSON object som representerar det OTP som ska skickas. Skall inkluderas i request body.
| alternativ | beskrivning | nödvändig | default value | 
|---|---|---|---|
| to | stringE164 formatted mobile number | Ja | |
| template | stringMUST contain{{CODE}}literal in it, which will be replaced by the generated OTP | Nej | {{CODE}} | 
| type | stringType of OTP required. Possible values:ALPHA,NUMERICandALPHANUMERIC | Nej | ALPHANUMERIC | 
| length | Integerlength of the OTP required.Max 20 | Nej | 4 | 
| expiry | Integertime in seconds after which the OTP will expire automatically. | Nej | 7200 | 
| status code | description | 
|---|---|
| 200 | successRequest sent successfully | 
| 400 | bad requestIncorrect or missing parameters | 
| 401 | unauthorizedInvalid credentials or incorrect authentication method | 
Headers
Content-type: application/json
Authorization: BASIC base64encodedCredentials
Body
{
  "to": "32412345678",
  "template": "Your verification code is `{{CODE}}`",
  "type": "NUMERIC",
  "length": 4,
  "expiry": 7200
}
{
    "code": 200,
    "message": "OK",
    "data": {
        "32412345678": {
            "code": 200,
            "status": "SENT"
        },
        "text": "Your verification code is 1234",
        "token": "1234",
        "expiry": 7200,
        "total_messages": 1
    }
}