ftos.identity.otp.send
IMPORTANT!
Starting with v24.3.0, this is renamed from server.otp.sendOtp to ftos.identity.otp.send.
Starting with v24.3.0, this is renamed from server.otp.sendOtp to ftos.identity.otp.send.
Sends a sms/email/IVR containing the server generated one-time password and returns the request ID to be used by method ftos.identity.otp.validate and ftos.identity.otp.getStatus.
This is a business logic method for business service components.
Syntax
With message parameter:
Copy
function ftos.identity.otp.send({"from": string, "to": string, "subject": string, "notificationProvider": string, "notificationChannel": string,"message": string {{otp}}})
With messageTemplateName parameter:
Copy
function ftos.identity.otp.send({"from": string, "to": string, "subject": string, "notificationProvider": string, "notificationChannel": string,"messageTemplateName": string{{otp}}}, “otpTimeout“: number)
| Parameter | Type | Description |
|---|---|---|
from
|
string | Email address/Phone number of the sender. |
to
|
string | Email address/Phone number of the recipient(s). |
subject |
string | Email subject (used only if the OTP is sent to an email address). |
notificationProvider
|
string |
A string defining the provider which will be used to send the email/sms/ivr. |
notificationChannel
|
string | The channel (SMS/Email/IVR) which will be used to send the OTP. |
message
|
string | The message that will be sent with the OTP. Use the {{otp}} placeholder to specify where the OTP should be placed inside the message. This parameter cannot be used together with messageTemplateName. |
messageTemplateName
|
string | The name of the message template used to construct the message to be sent with the OTP. The message template must contain the {{otp}} placeholder to specify where the OTP should be placed. This parameter cannot be used together with message. |
otpTimeout
|
number | Expiration time of the OTP, in seconds. The default value is 300 seconds. |
Examples
In this example:
-
We send the OTP to the +40701234567 phone number.
-
The
notificationChannelis ivr. -
The
messagecontains only the OTP.
Copy
function ftos.identity.otp.send({"from": "", "to": "+40712345678", "subject": "", "notificationProvider": "FtosIVRNotificationService", "notificationChannel":" ivr","message": "{{otp}}}")
In this example:
- We send an email to jane.smith@mail.com.
- The email is sent from testfintechos@mail.com.
- The email is sent immediately using the email service provider (GatewayEmailOtp).
- The message template used for this email is the templatetest template.
- The one-time password will expire in 600 seconds.
Copy
ftos.identity.otp.send({"testfintechos@mail.com", "jane.smith@mail.com", "otp test", "GatewayEmailOTP", "email", "templatetest"{{otp}}}, “otpTimeout“: 600)