Simple call
| Method | start.simple_call |
|---|---|
| API version | v4.0 |
| Description | Call any numbers except your own virtual ones. This is not a call from an employee to any number. |
| Return to list of methods | |
Request parameters
| Name | Type | Required | Valid values | Description | |
|---|---|---|---|---|---|
| access_token | string | yes | Authentication session key | ||
| first_call | string | yes | contact, operator |
Defines the number to call first:
|
|
| switch_at_once | boolean | no | true, false |
Default value first_call has the value operator and the parameter operator_message is specified, then the call is made to the operator, the operator, after picking up the handset, listens to the message to the end, then a call is made to contact and if the parameter switch_at_once has the value true and the parameter is specified contact_message, then for the shoulder contact playback
messages will be interrupted. When dialing to contact, operator listens to the message specified in the media_file_id parameter. Accordingly, if switch_at_once has the value false and the contact_message parameter is specified, then for the contact arm the message will be played to the end.If the first_call parameter has the value contact and the contact_message parameter is specified, then a call is made to the client, the client, after picking up the handset, begins to listen to the message and at the same time a call is made to operator and if the switch_at_once parameter has the value true and the parameter is specified operator_message, then after picking up the handset on operator the playback of messages will be interrupted for contact and operator. Accordingly, if switch_at_once has the value false, then for the shoulder contact and operator the message will be played to the end. If someone else's message has finished playing earlier, then he listens to the message specified in the media_file_id parameter.
|
|
| early_switching | boolean | no | true, false |
Default value If the parameter has the value For example, an operator is waiting for a call to reach a subscriber, but the subscriber is unavailable and his voicemail is activated, then when the parameter The parameter can have the value |
|
| media_file_id | number | no |
The default value is the system melody "Forwarding Music" ( Sets the audio file ID for the forward music. The file can be either system or and custom. You can get a list of system or user files using DATA API - Getting a list of user files, Getting a list of system files. Always plays to the arm for which one of the parameters |
||
| virtual_phone_number | string | yes |
Virtual number rented by the client. The number format must comply with internationalE.164 standard (for example, |
||
| virtual_phone_usage_rule | string | no |
Rules for using a virtual number. Allows you to dynamically change the virtual number when calling. If the number is suitable,
that satisfies the selected rule is not found, the number specified in the
The default rule is |
||
| show_virtual_phone_number | boolean | no | true, false |
Default value Whether to show the virtual number specified in the |
|
| contact | string | yes |
The number of the subscriber to which the call is made. The number format must match
international standard E.164 (for example, Employee extension numbers are not supported. |
||
| external_id | string | no | A unique identifier that can be used to associate a call event with an external system. | ||
| dtmf_string | string | no | 0-9, *, # | Specifies the DTMF that will be sent to the subscriber specified in the contact parameter. C
Using the symbol . = '1 second' you can set a timeout after which the DTMF symbol will be sent. Example: .12.1..4, i.e. after 1 second
the number 12 will be sent, then after 1 second the number 1 will be sent and after 2 seconds the number 4.
|
|
| direction | string | no | in, out | The default value is in. Determines the direction of the call in - Incoming call, out - Outgoing call.
|
|
Operator with which the subscriber will be connected from the parameter contact |
|||||
| operator | string | yes |
The operator number to which the subscriber will be connected from the contact parameter. The operator has access to call control through talk options. The number format must comply with the international standard E.164 (for example, “79091234567”).
Not an employee and will not appear in reports as an employee |
||
| operator_confirmation | string | no | 0-9, *, #, any | Receive confirmation from the operator that you are ready to accept the call. If you specify the value "any", then confirmation of readiness to accept a call will be made by pressing any key. | |
| contact_message | object | no |
Defines the parameters of the message that needs to be played to the subscriber specified in the After the message has finished playing, the message from the parameter will be played in a circle
|
||
| type | string | yes | media, tts |
Defines the message type. |
|
| value | string | yes |
If the If the The length of the TTS message is regulated by the tariff plan and the established limit. |
||
Message to be played to the subscriber specified in the parameter operator |
|||||
| operator_message | object | no |
Defines the parameters of the message that needs to be played to the subscriber specified in the After the message has finished playing, the message from the parameter will be played in a circle
|
||
| type | string | yes | media, tts |
Defines the message type. |
|
| value | string | yes |
If the If the The length of the TTS message is regulated by the tariff plan and the established limit. |
||
Response parameters
| Title | Type | Required | Description |
|---|---|---|---|
| call_session_id | number | yes | Unique call session identifier |
Example request```json
{ "jsonrpc": "2.0", "method": "start.simple_call", "id": "req1", "params": { "access_token": "2fRN4g217ca0b4224a67988aff3e584f91964a692045415f36fa66146f5a3c1ae1f6093d", "first_call": "operator", "switch_at_once": true, "media_file_id": 2701, "show_virtual_phone_number": false, "virtual_phone_number": "74993720692", "external_id": "334otr01", "dtmf_string": ".1.2.3", "direction": "in", "contact": "79260000000", "operator":"79262444491", "contact_message": { "type": "tts", "value": "Привет" }, "operator_message": { "type": "media", "value": "2561" } } }
#### Sample answer```json
{
"jsonrpc": "2.0",
"id": "req1",
"result": {
"data": {
"call_session_id": 237859081
}
}
}
List of returned errors
| Error text | Error code | Mnemonics | 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 |
Message length has exceeded the permissible limit set by the tariff 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 |
If you use a virtual number that does not belong to the client |
Parameter contact can not contain own virtual phone number |
-32602 | own_virtual_phone_number_not_allowed |
Calling your own virtual number is prohibited |
The contact {contact} has been found in the blacklist |
-32002 | contact_in_blacklist |
|
| The character encoding must be UTF-8 | -32602 | character_encoding_not_allowed |
See also section "List of errors common to all methods"