Skip to content

Hold call

Holding call

Method hold.call
API version v4.0
Description Holding call
Go back to list of methods

Parameters of a request

Title Type Required Valid value Description
access_token string yes Authentication session key
call_session_id number yes nique ID of a call session, that you can get in a reply message after calling the methods start.vnumber_call, start.scenario_call, start.employee_call, via a notification server or REST API.
Playing a message for a calling subscriber
contact_message object yes Defines parameters of a message that should be played to a calling subscriber. A calling subscriber is a number from the contact parameter in the methods: start.informer_call, start.vnumber_call, start.scenario_call, start.employee_call or subscriber calling a virtual PBX.
type string yes media, tts

Defines type of a message: media is a media file or tts - is a text for voice synthesis service Text-to-Speech.

value string yes

If the field type has media in it, ID of a media file to be played is used as value. The file can be both system and user. You can access media file ID via REST API - Receiving a list of user files, Receiving a list of system files.

If the field type has tts in it, text for voice synthesis is used as value.

Length of a TTS message depends on your service plan or a limit.

Example of a request

{
  "jsonrpc": "2.0",
  "method": "hold.call",
  "id": "req1",
  "params": {
    "access_token": "2fRN4g217ca0b4224a67988aff3e584f91964a692045415f36fa66146f5a3c1ae1f6093d",
    "call_session_id": 23465781,
    "contact_message": {
      "type": "media",
      "value": "2034"
    }
  }
}

Example of a reply

{
  "jsonrpc": "2.0",
  "id": "req1",
  "result": {
    "data": {
      "success": "true"
    }
  }
}

List of returning errors

Text of error Code of error Mnemonics of error Description
This method can not be called in this state -32004 invalid_state Method can be called only in condition Talk (refer to Diagram of call statuses)
The media file with id {media_file_id} not found -32602 media_file_not_found
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 limits of your service plan
The character encoding must be UTF-8 -32602 character_encoding_not_allowed

Refer to list of errors common for all methods