Start scenario call
Scenario call
Method | start.scenario_call |
---|---|
API version | v4.0 |
Description | Method allows you to make calls according to a customized acenario. To use the method you only need a virtual phone number and N scenario. |
Go back to list of methods |
Parameters of request
Title | Type | Required | Valid value | Description | |
---|---|---|---|---|---|
access_token | string | yes | Authentication session key | ||
virtual_phone_number | string | yes |
Virtual number, rented by client. Format of the number should comply with the international standart E.164 (for example, |
||
external_id | string | no | Unique ID, that can be used to connect call action with an outside system. | ||
dtmf_string | string | no | 0-9, *, # | Sets DTMF, that will be sent to a subscriber from the contact parameter. You can set a timeout for when to dispatch DTMF using symbol . = '1 second'. For example: .12.1..4 , i.e. in 1 second the figure 12 will be sent, in another second the figure 1 will be sent, and than in 2 seconds the figure 4 will be sent.
|
|
contact | string | yes |
A number that is used to reach a subscriber. Its format should comply with international standart E.164 (for example, If the parameter Employees' extension numbers are not supported. |
||
first_call | string | yes | contact, employee |
Defines number, that should be reached in the first place:
|
|
switch_at_once | boolean | no | true, false |
Default value is If the
If the parameter
If the parameter |
|
scenario_id | number | yes | Unique scenario ID that can be accessed by using REST API - Receiving a list of scenarios. | ||
direction | string | no | in, out | Default value is in . Defines direction of a call: in - Incoming call, out - Outgoing call.
|
|
Message that a contact listens to. |
|||||
contact_message | object | no |
Defines parameters of the message that a As the message is played, a system melody is played continually -
|
||
type | string | yes | media, tts |
Defines a type of a message. |
|
value | string | yes |
If the field If the field Length of a TTS message depends on your service plan or a limit. |
||
Message that is played for an employee | |||||
employee_message | object | no |
Defines parameters of a message that's going to be played for an employee. A message for an employee specified in the scenario has a higher priority than a message from the `employee_message` parameter. However both of the messages will be played in sequence.After a message is played, the code>media_file_id message will be played continually. |
||
type | string | yes | media, tts |
Defines the type of a message. |
|
value | string | yes |
If the field If the field Length of a TTS message depends on your service plan or a limit. |
Parameters of a reply
Title | Type | Required | Description |
---|---|---|---|
call_session_id | number | yes | Unique call session ID |
Example of a request
{
"jsonrpc": "2.0",
"method": "start.scenario_call",
"id": "req1",
"params": {
"access_token": "2fRN4g217ca0b4224a67988aff3e584f91964a692045415f36fa66146f5a3c1ae1f6093d",
"virtual_phone_number": "74993720692",
"external_id": "34rty567",
"dtmf_string": "..1.2.3",
"contact": "79260000000",
"first_call": "employee",
"switch_at_once": false,
"scenario_id": 23456,
"direction": "in",
"contact_message": {
"type": "media",
"value": "237"
},
"employee_message": {
"type": "media",
"value": "237"
}
}
}
Example of a reply
{
"jsonrpc": "2.0",
"id": "req1",
"result": {
"data": {
"call_session_id": 234568
}
}
}
List of returning errors
Text of error | Code of error | Mnemonics of error | Description |
---|---|---|---|
The maximum length of Text-to-Speech message is {tts_message_max_length }. The length of your message is {sent_tts_message_length } |
-32602 | tts_text_exceeded |
Length of your message exceeded the limit of your service plan |
The media file with id {media_file_id } not found |
-32602 | media_file_not_found |
|
Virtual phone number {virtual_phone_number } not found. It is not your virtual phone number. |
-32007 | virtual_phone_number_not_found |
Virtual number does not belong to the client |
Scenario with id {scenario_id } not found |
-32602 | scenario_not_found |
|
Parameter contact can not contain own virtual phone number |
-32602 | own_virtual_phone_number_not_allowed |
Calls to own virtual numbers are not permitted |
The contact {contact } has been found in the blacklist |
-32602 | contact_in_blacklist |
|
The character encoding must be UTF-8 | -32602 | character_encoding_not_allowed |
Refer to section List of errors common for all methods