### Configure IVR 'start' action for Background Music using RingMe API Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901920955/ivr This example configures the IVR to play a background music file, 'hello.wav', after the foreground music. This action is also part of the 'start' sequence within the IVR context. ```json { "digits": "start", "action": "play_background", "sound_id": 51 } ``` -------------------------------- ### View Available IVR Context Options in RingMe API Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901920955 This example shows how to retrieve a list of all configured options within an IVR context. It displays the available digits or keywords that trigger specific actions, such as 'start', 'timeout', 'invalid', '1', and '2'. ```json [ { "digits": "start" }, { "digits": "timeout" }, { "digits": "invalid" }, { "digits": "2" }, { "digits": "1" } ] ``` -------------------------------- ### Configure Foreground Audio Playback in RingMe IVR Context Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901920955 This snippet demonstrates configuring the 'start' option within an IVR context to play a foreground audio file. It specifies the action to be taken when the IVR starts, in this case, playing 'advertising.wav'. ```json { "digits": "start", "action": "play", "params": { "file_id": 52, "loop": 1 } } ``` -------------------------------- ### Get Fax Message Status Example Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921081 Example of an HTTP GET request to retrieve the status of a specific fax message and its corresponding JSON response. ```HTTP GET /extension/122/fax/out/175 ``` ```JSON { "status": "sent", "dst_num": "1234567", "id": 175, "datetime": "2016-04-11 18:07:53" } ``` -------------------------------- ### Example API Request for User Information Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1981448215 An example of an API request to retrieve information about the currently authorized user. This demonstrates a typical GET request structure. ```http GET /api/v2/user/me Host: api.ringme.com Authorization: Bearer ``` -------------------------------- ### Get Disk Space Information (API Example) Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921258/disk_space This snippet demonstrates how to retrieve disk space information for a client using the Ringme Confluence API. It shows the GET request endpoint and the structure of the JSON response, which includes details like total space, free space, and counts/sizes of various record types. ```http GET /client/{client_id}/disk_space/ ``` ```json { "total_space": 10485760, "fax_size": 0, "voicemail_count": 0, "free_space": 10485760, "fax_count": 0, "call_records_size": 0, "voicemail_size": 0, "call_records_count": 0 } ``` -------------------------------- ### Example POST Event for Speech-to-Text Data Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921700/speech%2Bto%2Btext This example demonstrates the structure of a POST request that might be received, containing call details and the transcribed text. The 'call_api_id', 'extension_id', and 'direction' are key identifiers. The 'text' field contains the recognized speech, which needs to be URL-decoded and UTF-8 decoded for readability. ```HTTP POST / HTTP/1.1 Host: 213.170.66.158:12345 User-Agent: Ringme Event Generator Accept: */* Accept-Encoding: gzip, deflate Content-Length: 394 Content-Type: application/x-www-form-urlencoded call_api_id=3232240860-15e67fb4-8f9a-11ea-90b9-05381d8e3a62&extension_id=34414&direction=out&text=%D0%90+%D0%B2%D0%BE%D0%B4%D0%B5+%D0%BC%D0%B8%D1%80+%D1%81%D0%B5%D0%B9%D1%87%D0%B0%D1%81+%D0%BB%D0%B5%D1%82+%D1%81%D0%B5%D0%B3%D0%BE+%D0%BA%D0%BE%D0%BC%D0%B0%D1%80%D0%B0+%D0%B7%D0%B0%D0%B1%D0%BE%D1%82%D0%B0+%D0%BB%D1%8E%D0%B4%D0%B8+%D1%87%D0%B0%D1%81%D1%83+%D1%81+15+%D0%B3%D0%BE%D0%B4%D0%B0 ``` -------------------------------- ### Voice Helper Configuration Example (JSON) Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921700/speech%2Bto%2Btext This JSON object demonstrates the configuration for a voice helper action, including sound playback, speech recognition timeouts, digit limits for dialing, and transcription rules for routing calls based on recognized speech. ```json { "voice_helper_sound": 52, "voice_helper_timeout": 7000, "id": 39, "voice_helper_digits_max": "2", "voice_helper_rules": [ { "transcription": "привет|здравствуй|здарова", "to_option": 1 }, { "transcription": "прощай|пока", "to_option": 2 } ], "final": true, "action": "voice_helper" } ``` -------------------------------- ### Get Outbound Call Rules (GET /client/{client_id}/dial_rule/) (HTTP Request) Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921139/dial_rule This is an example of an HTTP GET request to retrieve the outbound call rules associated with a specific client. The response will contain a JSON object detailing all the configured `dial_rules` for that client. ```http GET /client/12/dial_rule/ HTTP/1.1 Host: api.example.com ``` -------------------------------- ### RingMe REST API - Quick Start Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901920307 This section outlines the initial steps for making requests to the RingMe virtual PBX REST API. It covers the base URL, authentication, and request/response formats. ```APIDOC ## RingMe REST API - Quick Start ### Description To make requests to the virtual PBX REST API, you need to create and authorize a trusted application. Requests to the REST API are made via the URL **https:///api/ver1.0/**, where is the address of your domain in the system, specified in the PDF file with PBX data sent to your email. The access token obtained during application authorization must be passed in the **Authorization** header in the format **"Bearer "** in each API request. Request parameters are passed in **application/x-www-form-urlencoded** format, and the request body (if any) is in **application/json** format. ### Method N/A (General information) ### Endpoint N/A (Base URL: https:///api/ver1.0/) ### Parameters #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (Example) - **dealer_id** (null) - Description not provided - **admin** (boolean) - Indicates if the user is an administrator. - **extra_params** (null) - Description not provided - **access** (string) - Access level (e.g., "full"). - **extension_id** (null) - Description not provided - **client_id** (integer) - The client identifier. - **extension_group_id** (null) - Description not provided - **timezone** (string) - The user's timezone (e.g., "Europe/Moscow"). - **login** (string) - The user's login name (e.g., "ringme_test"). - **id** (integer) - The user's unique identifier. #### Response Example ```json { "dealer_id": null, "admin": false, "extra_params": null, "access": "full", "extension_id": null, "client_id": 32362, "extension_group_id": null, "timezone": "Europe/Moscow", "login": "ringme_test", "id": 73870 } ``` ``` -------------------------------- ### GET /extension/alive/ Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/3319857153/alive This resource is intended to determine the status of a phone terminal on the ATC. The result can be used, for example, to understand if an extension is available for transfer or not. ```APIDOC ## GET /extension/alive/ ### Description This endpoint retrieves the status of an internal phone extension, indicating its availability for calls. ### Method GET ### Endpoint /extension/alive/ ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **extension_id** (integer) - Unique identifier of the internal extension. - **status** (object) - The status of the internal extension. It has a nested data structure. - **busy** (boolean) - True if the extension is busy in a call, unavailable for calls. - **registered** (boolean) - True if the extension is available for calls (dynamic equipment registration, or the extension is an ALIAS (FMC), or static equipment registration on the extension, or an external number registration on the extension), False if the extension is unavailable for calls. - **tls** (boolean) - Dynamic registration, encryption is used in the call. - **webrtc** (boolean) - Dynamic registration via web socket. #### Response Example ```json { "extension_id": 12345, "status": { "busy": false, "registered": true, "tls": true, "webrtc": false } } ``` ``` -------------------------------- ### Initiate Call (ClickToCall/Callback) Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921927 Describes the process for initiating calls, where the system first calls the source number and then the destination number upon successful answer. It also provides recommendations for setting caller ID information. ```APIDOC ## Initiate Call (ClickToCall/Callback) ### Description Initiates a call by first dialing the source number (`src_num`) and then, upon successful answer, dialing the destination number (`dst_num`). Recommendations are provided for setting `caller_id_name` and `caller_id_number` to match `dst_num` for internal calls. ### Method POST (Implied for initiating an action) ### Endpoint `/initiate_call` (Hypothetical endpoint for this functionality) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **src_num** (string) - Required - The source number to call first. - **dst_num** (string) - Required - The destination number to call after the source answers. - **caller_id_name** (string) - Optional - The caller ID name to display. - **caller_id_number** (string) - Optional - The caller ID number to display. ### Request Example ```json { "src_num": "+1234567890", "dst_num": "+1987654321", "caller_id_name": "+1987654321", "caller_id_number": "+1987654321" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the call initiation. - **call_id** (string) - A unique identifier for the initiated call. #### Response Example ```json { "status": "initiated", "call_id": "call_abc123" } ``` ``` -------------------------------- ### Configure Background Audio Playback in RingMe IVR Context Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901920955 This example shows how to configure the playback of a background audio file ('hello.wav') within an IVR context. This action is typically set up to play concurrently with other operations or during specific call states. ```json { "digits": "start", "action": "play", "params": { "file_id": 51, "loop": 0, "background": true } } ``` -------------------------------- ### Get Client Limits API Response Example Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901920659 This snippet shows the expected JSON response when querying for client limits via the Ringme Confluence API. It details various limits such as disk quota, application limits, and call limits. ```json { "disk_quota": 10485760, "application_limit": 10, "ivr_rule_limit": 2000, "user_extension_group_limit": 100, "extension_agent_limit": 100, "sound_limit": 30, "ivr_option_limit": 100, "user_client_limit": 100, "extension_group_limit": 5, "user_extension_limit": 100, "network_permission_limit": 20, "calls_limit": 50, "remote_agent_limit": 500, "event_limit": 25, "extension_limit": 5, "extension_phone_limit": null, "extension_queue_limit": null, "extension_ivr_limit": null, "extension_fax_limit": null, "extension_conference_limit": null, "dial_rule_limit": null, "incom_rule_limit": 500, "ivr_context_limit": 100, "reg_limit": 0, "interval_limit": 500, "client_extension_application_limit": 1 } ``` -------------------------------- ### Callback Initiation Example (Ringme API) Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921397 Demonstrates how to initiate a callback using the Ringme API. This involves a POST request to the callback endpoint with destination and source numbers. The response includes details of the initiated callback. ```json POST /extension/@200/callback/ { "dst_num": "+79817654321", "src_num": [ "200" ] } ``` -------------------------------- ### Get List of External Numbers (DID) - API Example Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921166 This snippet demonstrates how to retrieve a list of external phone numbers (DIDs) available to a client using the Ringme API. It shows the expected JSON response format, including details like comment, domain, creation date, name (the DID itself), assigned extension ID, client ID, and message settings. This is useful for understanding the current state of DIDs. ```json [ { "comment": "DID1", "domain": null, "create_date": "2020-05-21 15:53:52", "name": "78123092631", "extension_id": 149, "client_id": 12, "id": 6, "allow_message": false, "message_extension_id": null } { "comment": "DID2", "domain": null, "create_date": "2020-05-21 15:58:05", "name": "000104839", "extension_id": null, "client_id": 12, "id": 10, "allow_message": false, "message_extension_id": null } ] ``` -------------------------------- ### Retry Fax Message Example Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921081 Example of an HTTP PUT request to retry sending a specific fax message and its corresponding JSON response indicating the new status. ```HTTP PUT /extension/122/fax/out/175?action=retry ``` ```JSON { "status": "ready_to_send", "dst_num": "123", "id": 175, "datetime": "2016-04-11 18:07:53" } ``` -------------------------------- ### POST /client/{client_id}/phone_events/ Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/3350528001 Sets up events that will be distributed to all PBX phone terminals for a specific client. ```APIDOC ## POST /client/{client_id}/phone_events/ ### Description Sets up events that will be distributed to all PBX phone terminals for a specific client. This endpoint can also be used to set the `extension-call-status` event type for tracking terminal status changes. ### Method POST ### Endpoint /client/{client_id}/phone_events/ ### Parameters #### Path Parameters - **client_id** (string) - Required - The unique identifier for the client. #### Query Parameters None #### Request Body - **event_type** (string) - Required - The type of event to set (e.g., `extension-call-status`). - **event_details** (object) - Optional - Specific details related to the event. ### Request Example ```json { "event_type": "extension-call-status", "event_details": { "status_changes": true } } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the event was set successfully. #### Response Example ```json { "message": "Phone events configured successfully for client." } ``` ``` -------------------------------- ### Initiate Call (Callback) Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921362 Initiates a call between specified numbers. The system calls all source numbers, and upon answering by one, it calls the destination number. Forwarding rules of source 'Phone Terminal' resources are ignored. ```APIDOC ## POST /extension/{extension_id}/callback/ ### Description Initiates a call between source and destination numbers. If a source number is a 'Phone Terminal', its forwarding rules are ignored. ### Method POST ### Endpoint `/extension/{extension_id}/callback/` ### Parameters #### Path Parameters - **extension_id** (string) - Required - The ID of the extension to initiate the callback from. #### Query Parameters None #### Request Body - **caller_id_name** (string) - Required - The name to display for the caller. - **caller_id_number** (string) - Required - The number to display for the caller. - **destination_number** (string) - Required - The number to call. - **source_number** (string) - Required - The number to initiate the call from. ### Request Example ```json { "caller_id_name": "Ivan", "caller_id_number": "+1234567890", "destination_number": "+1987654321", "source_number": "+1122334455" } ``` ### Response #### Success Response (200) - **call_id** (string) - The unique identifier for the initiated call. #### Response Example ```json { "call_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` ``` -------------------------------- ### GET /extension/{extension_id}/conference/status/ Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921741/conference Retrieves the status of an active conference. Supports actions like showing members, checking lock status, and getting participant counts. ```APIDOC ## GET /extension/{extension_id}/conference/status/ ### Description Retrieves the status of an active conference. You can specify an action to get specific details like the list of members, lock status, maximum participants, current participant count, or the conference runtime. ### Method GET ### Endpoint `/extension/{extension_id}/conference/status/` ### Parameters #### Path Parameters - **extension_id** (string) - Required - The ID of the extension. #### Query Parameters - **action** (string) - Required - The action to perform. Possible values: `show_members`, `is_locked`, `max_members`, `count`, `run_time`. ### Request Example ```json { "action": "show_members" } ``` ### Response #### Success Response (200) - **members** (array) - List of conference members (when action is `show_members`). Each member is an object with `member_id`, `member_number`, `member_name`, `muted`, `deafed`, `moderator`, and `call_api_id`. - **is_locked** (boolean) - Indicates if the conference is locked. - **max_members** (integer) - Maximum number of participants allowed. - **count** (integer) - Current number of participants. - **run_time** (integer) - Duration of the conference in seconds. #### Response Example (for show_members) ```json { "members": [ { "member_id": 123, "member_number": "101", "member_name": "John Doe", "muted": false, "deafed": false, "moderator": true, "call_api_id": "abc-123" } ], "is_locked": false, "max_members": 10, "count": 2, "run_time": 300 } ``` ``` -------------------------------- ### Ringme Confluence Valet Park API - Example Log Entry Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921675/valet_park This is an example log entry showing an incoming call event with various parameters. Key parameters like CallAPIID and EventType ('answer') are important for subsequent API interactions related to call parking and management. ```Log 213.170.66.152 - - [04/Jun/2020 13:33:10] "GET /?CalledExtension=022*341@siptest.ringme.ru& CalledExtensionID=34414&CallerExtension=022*200@siptest.ringme.ru&CallerExtensionID=32494&EventType=answer& CallID=c69226e0a64e11eaa0086fd86d94a0e0&CallerIDNum=000117443&CallerIDName=via200t&CalledDID=78123093582& CallStatus=ANSWER&CallFlow=in&CalledNumber=022*341&SubCallID=34414-c8874b88a64e11eaa0406fd86d94a0e0 &CallAPIID=3232240860-37b98fb2-a66c-11ea-ae69-6fd86d94a0e0&EventTime=1591266790576760 HTTP/1.1" 200 - ``` -------------------------------- ### GET /api/user/me Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921834 Retrieves information about the currently authorized user. ```APIDOC ## GET /api/user/me ### Description This endpoint retrieves information about the authenticated user associated with the provided access token. ### Method GET ### Endpoint `/api/user/me` ### Parameters #### Query Parameters None #### Request Body None ### Request Example ``` GET /api/user/me HTTP/1.1 Host: api.ringme.com Authorization: Bearer ``` ### Response #### Success Response (200) - **admin** (boolean) - Indicates if the user is an administrator. - **client_id** (integer) - The ID of the client. - **dealer_id** (integer | null) - The ID of the dealer, if applicable. - **extension_group_id** (integer | null) - The ID of the extension group, if applicable. - **extension_id** (integer | null) - The ID of the extension, if applicable. - **id** (integer) - The unique identifier of the user. - **login** (string) - The login name of the user. #### Response Example ```json { "admin": false, "client_id": 12, "dealer_id": null, "extension_group_id": null, "extension_id": null, "id": 20, "login": "client1" } ``` ``` -------------------------------- ### Upload Sound Files to RingMe API Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901920955 This snippet demonstrates how to upload sound files (e.g., 'hello.wav', 'advertising.wav') to the RingMe API. It shows the expected JSON response containing the file ID and client ID, which are necessary for subsequent configurations. ```json { "id": 51, "client_id": 12, "title": "мой файл приветствия", "dealer_id": null, "filename": "hello.wav" } { "id": 52, "client_id": 12, "title": "мой файл рекламы", "dealer_id": null, "filename": "advertising.wav" } ``` -------------------------------- ### GET /extension/call_property/ Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/3316449293/call_property Retrieves a list of all available call properties. ```APIDOC ## GET /extension/call_property/ ### Description Retrieves a list of all available call properties that can be set for extension statuses. ### Method GET ### Endpoint /extension/call_property/ ### Parameters #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **mnemo** (string) - The mnemonic identifier for the call property. - **Описание** (string) - A description of the call property. #### Response Example ```json { "call_properties": [ { "mnemo": "all", "Описание": "Разрешены все звонки" }, { "mnemo": "cq", "Описание": "\"Активный обзвон\" То только для Инициация вызова (/callback/)Preview" } ] } ``` ``` -------------------------------- ### Get List of Sound Files Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921337 Retrieves a list of all sound files available for a client or extension. The list includes details such as ID, title, and ownership. ```APIDOC ## GET /client/{client_id}/sound/ ### Description Retrieves a list of all sound files associated with a specific client. ### Method GET ### Endpoint `/client/{client_id}/sound/` ### Parameters #### Path Parameters - **client_id** (integer) - Required - The ID of the client. ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the sound file. - **title** (string) - The title of the sound file. - **client_id** (integer) - The ID of the client owning the sound file. - **dealer_id** (integer) - The ID of the dealer owning the sound file (or null). - **filename** (string) - The system filename. #### Response Example ```json [ { "id": 101, "title": "Greeting 1", "client_id": 456, "dealer_id": null, "filename": "greeting1.wav" }, { "id": 102, "title": "Voicemail Intro", "client_id": 456, "dealer_id": null, "filename": "vm_intro.mp3" } ] ``` ``` ```APIDOC ## GET /extension/{extension_id}/sound/ ### Description Retrieves a list of all sound files associated with a specific extension (internal number). ### Method GET ### Endpoint `/extension/{extension_id}/sound/` ### Parameters #### Path Parameters - **extension_id** (integer) - Required - The ID of the extension. ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the sound file. - **title** (string) - The title of the sound file. - **client_id** (integer) - The ID of the client owning the sound file. - **dealer_id** (integer) - The ID of the dealer owning the sound file (or null). - **filename** (string) - The system filename. #### Response Example ```json [ { "id": 201, "title": "Extension Greeting", "client_id": null, "dealer_id": null, "filename": "ext_greeting.wav" } ] ``` ``` -------------------------------- ### Get Queue Parameters Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921021/queue Retrieves the current parameters for a specified queue. ```APIDOC ## GET /extension/{extension_id}/queue/ ### Description Retrieves the current parameters for a specified queue. ### Method GET ### Endpoint `/extension/{extension_id}/queue/` ### Parameters #### Path Parameters - **extension_id** (string) - Required - The ID of the extension associated with the queue. ``` -------------------------------- ### Create IVR Extension using RingMe API Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901920955 This code example shows how to create a new IVR extension using the RingMe API. It specifies the extension type as 'ivr' and includes details like status, domain, and a descriptive label. The response provides the unique ID for the newly created IVR extension. ```json { "status": "active", "domain": "sip.ringme.ru", "create_date": "2020-03-20 17:11:10", "name": "000*071", "dial_rule_limit": null, "extension_group_id": null, "label": "тестовый IVR", "caller_id_name": null, "client_id": 12, "extra_params": null, "message_did": null, "dial_rule_id": null, "ani_rfc3325": false, "type": "ivr", "id": 204, "did_as_transfer_caller_id": null } ``` -------------------------------- ### Callback with Dynamic Variables and Predefined Settings Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/2361458689 This example illustrates how to initiate a callback request with dynamic variables and predefined settings like 'autoanswer' and 'tag'. It shows how to pass custom variables and leverage system-defined ones for call behavior. ```json { "dst_num": "000116644", "src_num": [ "341" ], "variables": {"autoanswer": "4", "testvar": "'testval'" } } ``` -------------------------------- ### Event Notification Response Example (Ringme API) Source: https://ringme-confluence.atlassian.net/wiki/spaces/Ringme/pages/1901921397 Shows example responses from the Ringme API when setting up event notifications for an extension. These responses detail the URL, HTTP method, event type, and a unique ID for each registered event. ```json { "url": "https://somehost.com/fordel/show.php?myid=175", "method": "GET", "event_type": "dial-out", "id": 72 } ``` ```json { "url": "https://somehost.com/fordel/show.php?myid=175", "method": "GET", "event_type": "answer", "id": 73 } ``` ```json { "url": "https://somehost.com/fordel/show.php?myid=175", "method": "GET", "event_type": "hangup", "id": 74 } ```