Connecting a coach to the conversation
| Method | add.coach |
|---|---|
| API version | v4.0 |
| Description | Connecting the trainer to the conversation |
| Return to list of methods | |
The method allows you to connect a trainer to the conversation, which is specified in your personal account or specified in the
phone_numberparameter
Request parameters
| Title | Type | Required | Description |
|---|---|---|---|
| access_token | string | yes | Authentication session key |
| call_session_id | number | yes | A unique call session identifier that can be received in a response message when calling the start.vnumber_call, start.scenario_call, start.employee_call methods using the notification server or DATA API. |
| phone_number | string | no | Coach number, if the coach specified in your personal account is not used. If the trainer number is not specified, then the trainer is connected from the employee’s settings in the personal account |
Example request```json
{ "jsonrpc": "2.0", "method": "add.coach", "id": "req1", "params": { "access_token": "2fRN4g217ca0b4224a67988aff3e584f91964a692045415f36fa66146f5a3c1ae1f6093d", "call_session_id": 27934036, "phone_number": "79260000000" } }
#### Sample answer```json
{
"jsonrpc": "2.0",
"id": "req1",
"result": {
"data": {
"success": "true"
}
}
}
List of returned errors
| Error text | Error code | Error mnemonics | Description |
|---|---|---|---|
| The coach not found in your settings | -32602 | coach_not_found |
|
| The phone number does not exist or inactive | -32602 | no_active_phone_number |
See also section "List of errors common to all methods"