Start employee call
Employee call
Method | start.employee_call |
---|---|
API version | v4.0 |
Description | The method implements a direct call to an employee and does not use any scenario. |
Go back to methods list |
Parameters of a request
Title | Type | Required | Valid value | Description | |
---|---|---|---|---|---|
access_token | string | yes | Authentication session key | ||
first_call | string | yes | contact, employee |
Specifies a number, that should be dialed in the first place:
|
|
switch_at_once | boolean | no | true, false |
Default value If the parameter
If the parameter
If the parameter |
|
early_switching | boolean | no | true, false |
Default value is If a parameter has value For example, an operator is trying to reach a subscriber, but the subscriber is unavailable, and the operator reaches his or hers voicemail. By activating the parameter A parameter can have value |
|
media_file_id | number | no |
System melody "Dialing music" ( Provides ID for a dialing music media file. This can be both a system and a user media file. You can access a list of system and user files by using REST API - Receiving a list of user files, Receiving a list of system files. Is always played for a call leg that does not have one of the parameters: |
||
virtual_phone_number | string | yes |
Virtual number, rented by client. Number's format should be the same as the international standart E.164 (for example, |
||
virtual_phone_usage_rule | string | no |
Virtual number rule. Dynamically changes virtual numbers in calls. If there is no number matching the conditions,
the system will use a number from a parameter
|
||
virtual_number_group | number | no |
Group number of the virtual number pool which settings will be used in the call.
For the group of virtual numbers to work correctly, you must also pass the parameter virtual_phone_usage_rule with any value other than fixed.
|
||
show_virtual_phone_number | boolean | no | true, false |
Default value is Shows an |
|
contact | string | yes |
A number of a subscriber that is being dialed. The number should follow the international standart E.164 (for example, Extension numbers of employees are not supported. |
||
external_id | string | no | Unique ID, that can be used to connect an event of a call with an outside system. | ||
dtmf_string | string | no | 0-9, *, # | Assigns DTMF, that will be sent to a contact . You can specify timeout for when the DTMF symbol is going to be sent by using a symbol . = '1 second'. Example: .12.1..4 , i.e. the number 12 will be sent in 1 second, a number 1 will be sent in another second, and than a number 4 will be sent in 2 seconds.
|
|
direction | string | no | in, out | Default value is in . Defines call direction in - Incoming call, out - Outgoing call.
|
|
An employee to take a call from a contact |
|||||
employee | object | yes | An employee that will take a call from contact . |
||
id | number | yes |
A unique ID of an employee. You can get an ID from REST API - Receiving employee information
If the parameter
|
||
phone_number | string | no |
Provides a number an employee that will take a call from a |
||
A message that a contact listens to |
|||||
contact_message | object | no |
Defines parameters of a message to play to a subscriber from the After the message is played, a
|
||
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 is defined by your service plan or a limit. |
||
A message employee listens to |
|||||
employee_message | object | no |
Defines parameters of a message an After the message is played, a
|
||
type | string | yes | media, tts |
Defines a type of a message. |
|
value | string | yes |
If the If the field Length of a TTS message is defined by your service plan or a limit. |
Example 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.employee_call",
"id": "req1",
"params": {
"access_token": "2fRN4g217ca0b4224a67988aff3e584f91964a692045415f36fa66146f5a3c1ae1f6093d",
"first_call": "employee",
"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",
"employee": {
"id": 25,
"phone_number": "79260000001"
},
"contact_message": {
"type": "tts",
"value": "Hello"
},
"employee_message": {
"type": "media",
"value": "2561"
}
}
}
Example of a reply
{
"jsonrpc": "2.0",
"id": "req1",
"result": {
"data": {
"call_session_id": 237859081
}
}
}
List of returning errors
Text of error | 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 |
Length of your message exceeded limits 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 is not attributed to client |
Employee with id {employee_id } not found. It is not your employee. |
-32602 | employee_not_found |
|
The phone number does not exist or inactive | -32602 | no_active_phone_number |
Employee does not have active phone numbers in the employee settings |
Parameter contact can not contain own virtual phone number |
-32602 | own_virtual_phone_number_not_allowed |
Calls to own virtual numbers are not allowed |
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 |
Refer to List of errors common for all methods