Create a scenario
Create Scenario Endpoint:
This resource describes a scenario identified by a unique ID, with creation and update timestamps. It includes settings such as name, sticky channel behavior with a specified TTL, and PSD2 compliance status. Additionally, it defines PIN options with a specified TTL, security measures including rate limiting based on IP and destination number, and block scores for fraud detection. The scenario also lists communication channels such as SMS, Viber, voice, and flashcall, each with their respective configurations like sender information, message content, and timing for the next event.
URL: baseURL/scenario
Method: POST
Headers:
Content-Type: application/json
principalId:{accountID}
Request Body:
This command sends a POST request to BaseURL/scenario with the specified JSON payload, including headers for content type and principal ID.
curl --location 'baseURL/scenario' \
--header 'Content-Type: application/json' \
--header 'principalId: 1' \
--data-raw '{
"settings": {
"name": "string",
"sticky_channel": false,
"psd2_compliant": false
},
"pin_options": {
"ttl": 320
},
"security": {
"rate_limiting": {
"ip": false,
"destination_number": false,
"interval": 3,
"max_attempts": 3
},
"block_scores": []
},
"channels": [
{
"channel": "sms",
"from": "Verify",
"message": "Your PIN is @@pin",
"flash": false,
"transcode": true,
"order": 1,
"next_event_in": 37
}
]
}'
Response Body:
{
"scenario_id": "7280ecaa-a132-4908-8f26-c1ecbe138d98",
"created_date": "2020-09-04T06:58:35Z",
"updated_date": "2020-09-04T06:58:35Z",
"settings": {
"name": "string",
"sticky_channel": true,
"sticky_channel_ttl": 7
},
"pin_options": {
"ttl": 320
},
"security": {
"rate_limiting": {
"ip": true,
"destination_number": true,
"interval": 3,
"max_attempts": 3
},
"block_scores": [
"high risk"
]
},
"channels": [
{
"flash": false,
"transcode": true,
"from": "Verify",
"message": "Your PIN is @@pin",
"channel": "sms",
"next_event_in": 37,
"order": 1
},
{
"sender_info_tracking_id": "0094d198-4dd2-4fb5-b451-d46aca191b27",
"message": "Dear customer your ACME inc PIN is @@pin",
"channel": "viber",
"next_event_in": 43,
"order": 2
},
{
"from": "ACME INC",
"dtmf_required": true,
"repeat": 3,
"language": "en_US",
"gender": "female",
"next_event_in": 60,
"message": "Dear customer your ACME inc PIN is @@pin",
"channel": "voice",
"order": 3
},
{
"channel": "flashcall",
"next_event_in": 30,
"order": 5
}
]
}
Where:
Parameter Name | Description | Validations | Default Values | Required |
---|---|---|---|---|
settings | An object representing various general settings for the scenario document | - | - | yes |
name | The name of the scenario | String - Max chars 60 | - | yes |
sticky_channel | A boolean value indicating whether this scenario will use the stickiness feature | Object | - | no |
sticky_channel_ttl | The time to keep track of the last used channel (days) | boolean | FALSE | no |
psd2_compliant | PSD2 is the 2nd Payment Services Directive established by the European Banking Authority (EBA). This directive is designed to drive payment innovation and data security by reducing competitive barriers, mandating new security processes and encouraging standardized technology. | boolean | FALSE | no |
pin_options | An object representing various settings for the PIN Code | Object | - | no |
ttl | The time frame that the PIN code is valid for verification (seconds) | int | 10 | yes |
security | An object representing various security settings | Object | - | yes |
rate_limiting | An object representing various rate-limiting settings | Object | - | yes |
ip | Indicates if rate-limiting applies for an IP | boolean | TRUE | yes |
destination | Indicates if rate-limiting applies for a destination address | boolean | TRUE | yes |
interval | The intervals for rate-limiting to apply (minutes) | int | TRUE | yes |
max_attempts | Maximum attempts allowed per IP and/or destination | int | TRUE | yes |
block_scores | An array representing which fraud score results will be automatically blocked for verification | object | FALSE | yes |
array_values | The values to block | string - Allowed values: high risk, moderate risk, low risk | - | True if block_scores array exists |
channels | An array of objects representing the channels used for verification | Object | - | yes |
channel | The name of the channel | Accepts: sms, viber, voice, flashcall | - | One of 4 values is required |
from | The sender of the message (SMS channel) | numeric string (max length 16) or alphanumeric string (max length 11) | Verify | yes if SMS channel is used |
message | The body of the message (SMS channel) | String - must contain @@pin argument once and only once | Your PIN is @@pin | yes |
flash | Indicates if the SMS is a flash SMS (SMS channel) | Boolean | FALSE | no |
transcode | Indicates if the message body will be transcoded (SMS channel) | Boolean | FALSE | no |
order | Defines the priority order | Numeric | 1 | yes |
next_event_in | Time for the next event in seconds | Numeric - min 20 max 60 for all channels except voice (min 60 max 120) | 30 | no |
sender_info_tracking_id | The ID of the registered Viber Sender (Viber channel) | string | - | yes if Viber channel is used |
message | The body of the message (Viber channel) | String - must contain @@pin argument once and only once | - | yes if Viber channel is used |
order | Defines the priority order | Numeric | 2 | yes |
next_event_in | Time for the next event in seconds | Numeric - min 20 max 60 | 30 | no |
from | The sender of the message (voice channel) | String | Verify | yes if voice channel is used |
message | The body of the message (voice channel) | String - must contain @@pin argument once and only once | Your PIN is @@pin | yes if voice channel is used |
language | The language for the message (voice channel) | String - Language of the voice message - VALUES: "en-US", "de-DE", "fr-FR", "it-IT", "pt-BR", "es-ES", "es-LA", "en-GB", "el-GR", "bg-BG", "pl-PL", "hu-HU", "sv-SE", "ru-RU" | en-US | yes if voice channel is used |
gender | The gender of the voice (voice channel) | String - Gender of the voice - VALUES: "male", "female" | male | yes if voice channel is used |
repeat | Number of repetitions of the message (voice channel) | int | 1 | no |
dtmf_required | Indicates whether to start playing the message after a tone is pressed (voice channel) | boolean | FALSE | no |
Updated 6 months ago