Create 2FA SMS or Voice message template
Once you have your 2FA application, create one or more message templates where your PIN will be dynamically included when you send the PIN message over SMS or Voice.
Authorizations:
Scopes:
path Parameters
appId required | string Example: 0933F3BC087D2A617AC6DCB2EF5B8A61 ID of application for which requested message was created. |
Request Body schema:
language | string Enum: "en" "es" "ca" "da" "nl" "fr" "de" "it" "ja" "ko" "no" "pl" "ru" "sv" "fi" "hr" "sl" "ro" "pt_pt" "pt_br" "zh_cn" "zh_tw" The language code which message is written in used when sending text-to-speech messages. If not defined, it will default to English ( | ||||||||||
messageText required | string Content of the message being sent which contains at minimum one placeholder for a PIN code ( | ||||||||||
pinLength | integer <int32> PIN code length. | ||||||||||
pinType required | string Enum: "NUMERIC" "ALPHA" "HEX" "ALPHANUMERIC" Type of PIN code that will be generated and sent as part of 2FA message. | ||||||||||
regional | object Region-specific parameters, often imposed by local laws. Use this, if country or region that you are sending a message to requires additional information. | ||||||||||
| |||||||||||
repeatDTMF | string If the PIN is sent as a voice message, the DTMF code allows the recipient to replay the message. | ||||||||||
senderId | string The name that will appear as the sender of the 2FA message (Example: CompanyName). | ||||||||||
speechRate | number <double> The speed of narration for messages sent as voice. Supported range is from | ||||||||||
voiceName | string Defines the voice that will be used for the chosen language (example: Joanna). For each supported language, we may offer different voices (learn more here). You can use this method to retrieve all voices for the given language. If not defined, it will default to the standard voice for the selected language (if available). If the standard voice is not available, the request will fail. To avoid that, you can choose one of the neural voices (charges will apply). |
Responses
successful response
Bad Request
Unauthorized
Forbidden
Not Found
Error responses
Internal Server Error
Error responses
Request samples
- Payload
- cURL
- Java
- C#
- Go
- Python
- PHP
- JavaScript
- NodeJs
- Ruby
{- "pinType": "NUMERIC",
- "messageText": "Your pin is {{pin}}",
- "pinLength": 4,
- "language": "en",
- "voiceName": "Joanna",
- "senderId": "Infobip 2FA",
- "repeatDTMF": "1#",
- "speechRate": 1
}
Response samples
- default
- 400
- 401
- 403
- 404
- 4XX
- 500
- 5XX
{- "messageId": "B628A31410306DDB2BFB0D9CF1F3A3FF",
- "applicationId": "19F2491982980DBC2C40E1597FD175AB",
- "pinPlaceholder": "{{pin}}",
- "messageText": "Your pin is {{pin}}",
- "pinLength": 4,
- "pinType": "ALPHANUMERIC",
- "language": "en",
- "voiceName": "Joanna",
- "senderId": "Infobip 2FA",
- "repeatDTMF": "1#",
- "speechRate": 1
}
Need assistance
Encountering issues
What's new? Check out
Unsure about a term? See