### Get User Info via cURL Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/user/get-user-info This example demonstrates how to retrieve detailed information about the authenticated user using a cURL request. It requires an OAuth bearer token for authorization. The output is typically a JSON object containing user details. ```shell curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` -------------------------------- ### Install Express Dependency Source: https://developer.vonage.com/en/vonage-business-cloud/smart-numbers/code-snippets/vbc-receive-inbound-call_source=vonage-business-cloud Installs the Express.js framework, which is used for creating the web server to handle incoming webhook requests. ```bash npm install express ``` -------------------------------- ### Get User Info Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/user/get-user-info This endpoint retrieves detailed information about the authenticated user. Ensure you replace the placeholder with your valid OAuth token. ```APIDOC ## GET /t/vbc.prod/vis/v1/self ### Description Retrieves detailed information about the authenticated user. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/vis/v1/self` ### Parameters #### Header Parameters - **Authorization** (string) - Required - Your OAuth token in the format 'Bearer bearer_token'. - **Content-Type** (string) - Required - Set to 'application/json'. ### Request Example ``` curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_BEARER_TOKEN' ``` ### Response #### Success Response (200) - **field1** (type) - Description of field1 - **field2** (type) - Description of field2 #### Response Example ```json { "example_field": "example_value" } ``` ``` -------------------------------- ### Initialize SDK as NPM Package Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/loading-contactpad This snippet demonstrates initializing the Open ContactPad SDK using an NPM package. It involves importing the `VonageDialer` module, optionally enabling click-to-dial, and then initializing the SDK with configuration options. This is suited for projects built with modern JavaScript tooling and module management. ```javascript const VonageDialer = require('@vgip/vonage-dialer-sdk'); VonageDialer.enableClickToDial(true); // Annotate phone numbers for click-to-dial VonageDialer.init({ provider: '[cc|uc]' /* other config options */ }, (dialer) => { // see "building with Open ContactPad" }); ``` -------------------------------- ### SDK Global Methods - Init Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/sdk-reference_source=vonage-business-cloud Initializes the Vonage dialer API and returns a dialer instance. It's essential for preparing the dialer interface. ```APIDOC ## Init ### Description Acquire a dialer API instance and ensure the dialer interface is ready (see SDK dialer instance methods). ### Method POST ### Endpoint /init ### Parameters #### Request Body - **dialerConfig** (object) - Required - Dialer configuration options. - **callback** (function) - Required - Callback function. ### Request Example ```json { "dialerConfig": { "debug": true }, "callback": "() => console.log('Dialer ready')" } ``` ### Response #### Success Response (200) - **dialer** (object) - The dialer instance object. #### Response Example ```json { "dialer": "dialer_instance_object" } ``` ``` -------------------------------- ### Webhook / List webhooks Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/overview Lists all configured webhooks. ```APIDOC ## GET /api/webhooks ### Description Lists all configured webhooks. ### Method GET ### Endpoint /api/webhooks ### Parameters #### Query Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **webhooks** (array) - A list of webhook objects. - **webhook_id** (string) - The unique identifier of the webhook. - **url** (string) - The URL of the webhook. #### Response Example ```json { "webhooks": [ { "webhook_id": "whk_1a2b3c4d", "url": "https://example.com/webhook-receiver" }, { "webhook_id": "whk_5e6f7g8h", "url": "https://another.com/handler" } ] } ``` ``` -------------------------------- ### GET /accounts/{account_id}/call-logs Source: https://developer.vonage.com/en/vonage-business-cloud/reports/code-snippets/retrieve-call-logs-for-account Retrieves a list of call logs for a specified Vonage Business Communications account. You can filter the results by start date and control the number of records per page and the current page number. ```APIDOC ## GET /accounts/{account_id}/call-logs ### Description Retrieves a list of all calls by account. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/reports/v1/accounts/$account_id/call-logs` ### Parameters #### Path Parameters - **account_id** (string) - Required - The Vonage Business Communications account ID. #### Query Parameters - **start_gte** (string) - Optional - Filter records by start date (greater than or equal to). Format: YYYY-MM-DD HH:mm:ss - **start_lte** (string) - Optional - Filter records by start date (less than or equal to). Format: YYYY-MM-DD HH:mm:ss - **page_size** (integer) - Optional - Number of records per page. Defaults to 100. - **page** (integer) - Optional - Current page number. Defaults to 1. ### Request Headers - **Authorization**: Bearer $bearer_token - **Accept**: application/json ### Request Example ``` curl --location --request GET 'https://api.vonage.com/t/vbc.prod/reports/v1/accounts/$account_id/call-logs?start:gte=$start_gte&start:lte=$start_lte&page_size=$page_size&page=$page' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **call_logs** (array) - A list of call log entries. - **call_id** (string) - The unique identifier for the call. - **start_time** (string) - The start time of the call (ISO 8601 format). - **end_time** (string) - The end time of the call (ISO 8601 format). - **duration** (integer) - The duration of the call in seconds. - **direction** (string) - The direction of the call (e.g., 'inbound', 'outbound'). - **from** (object) - Information about the calling party. - **number** (string) - The phone number. - **type** (string) - The type of number (e.g., 'user', 'vbc_number'). - **to** (object) - Information about the called party. - **number** (string) - The phone number. - **type** (string) - The type of number. - **user_id** (string) - The ID of the user associated with the call. - **user_name** (string) - The name of the user associated with the call. - **account_id** (string) - The account ID. #### Response Example ```json { "call_logs": [ { "call_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "start_time": "2023-10-27T10:00:00Z", "end_time": "2023-10-27T10:05:30Z", "duration": 330, "direction": "outbound", "from": { "number": "+11234567890", "type": "user" }, "to": { "number": "+10987654321", "type": "vbc_number" }, "user_id": "user-123", "user_name": "John Doe", "account_id": "your_account_id" } ] } ``` #### Error Response (401) - **error** (string) - Unauthorized. Missing or invalid token. #### Error Response (404) - **error** (string) - Account not found. ``` -------------------------------- ### GET /t/vbc.prod/vis/v1/self/account Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/account/get-account-info_source=vonage-business-cloud Fetches detailed information about the authenticated account. ```APIDOC ## GET /t/vbc.prod/vis/v1/self/account ### Description This endpoint retrieves detailed information about the authenticated account. It requires an OAuth token for authorization. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/vis/v1/self/account` ### Parameters #### Header Parameters - **Authorization** (string) - Required - Your OAuth token in the format `Bearer `. - **Content-Type** (string) - Required - Should be set to `application/json`. ### Request Example ```json { "example": "curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/account' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token'" } ``` ### Response #### Success Response (200) - **account_id** (string) - The unique identifier for the account. - **account_name** (string) - The name of the account. - **status** (string) - The current status of the account (e.g., 'ACTIVE', 'SUSPENDED'). - **created_at** (string) - The timestamp when the account was created. #### Response Example ```json { "example": "{\n \"account_id\": \"acc-1234567890abcdef\",\n \"account_name\": \"My Vonage Business Cloud Account\",\n \"status\": \"ACTIVE\",\n \"created_at\": \"2023-10-27T10:00:00Z\"\n}" } ``` ``` -------------------------------- ### Initialize Vonage Dialer SDK Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/sdk-reference Initializes the Vonage Dialer SDK and provides a dialer instance. This is typically the first step before using other SDK functionalities. It requires a callback function to receive the dialer instance. ```javascript VonageDialer.init({ debug: true }, (dialer) => { // dialer instance is now available }); ``` -------------------------------- ### Get Account Info Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/account/get-account-info Retrieves detailed information about the authenticated account. ```APIDOC ## GET /t/vbc.prod/vis/v1/self/account ### Description This endpoint retrieves detailed information about the authenticated account. ### Method GET ### Endpoint `/t/vbc.prod/vis/v1/self/account` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/account' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **account_id** (string) - The unique identifier for the account. - **account_name** (string) - The name of the account. - **type** (string) - The type of account (e.g., 'standard', 'enterprise'). - **status** (string) - The current status of the account (e.g., 'active', 'suspended'). - **created_at** (string) - The date and time the account was created. #### Response Example ```json { "account_id": "acc_12345abc", "account_name": "Example Business Account", "type": "enterprise", "status": "active", "created_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Get Webhook Details Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/webhook/get-webhook-details_source=vonage-business-cloud Retrieves details for a specific webhook using its unique identifier. ```APIDOC ## GET /t/vbc.prod/vis/v1/self/webhooks/{id} ### Description Retrieves details on a specific webhook. ### Method GET ### Endpoint `/t/vbc.prod/vis/v1/self/webhooks/$id` ### Parameters #### Path Parameters - **id** (string) - Required - Unique identifier of the webhook #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/webhooks/$id' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **webhook_details** (object) - Contains the details of the webhook. #### Response Example ```json { "webhook_details": { "id": "string", "event_url": "string", "event_type": "string", "status": "string" } } ``` ``` -------------------------------- ### Webhook / Create a new webhook Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/overview Creates a new webhook to receive real-time events. ```APIDOC ## POST /api/webhooks ### Description Creates a new webhook to receive real-time events. ### Method POST ### Endpoint /api/webhooks ### Parameters #### Request Body - **url** (string) - Required - The URL to send webhook events to. - **event_types** (array) - Optional - A list of event types to subscribe to. If not provided, all events are sent. ### Request Example ```json { "url": "https://example.com/webhook-receiver", "event_types": ["call.started", "call.ended"] } ``` ### Response #### Success Response (200) - **webhook_id** (string) - The unique identifier of the created webhook. - **url** (string) - The URL of the webhook. - **event_types** (array) - The subscribed event types. #### Response Example ```json { "webhook_id": "whk_1a2b3c4d", "url": "https://example.com/webhook-receiver", "event_types": ["call.started", "call.ended"] } ``` ``` -------------------------------- ### Get Event Details using cURL Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/event/get-an-event This snippet shows how to make a GET request to retrieve details for a specific event. It requires an OAuth bearer token for authentication and the unique identifier of the event. The response will contain the event's details. ```curl curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/events/:id' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` -------------------------------- ### Initialize Express Server Node.js Source: https://developer.vonage.com/en/vonage-business-cloud/smart-numbers/code-snippets/vbc-route-to-extension This Node.js code snippet initializes an Express application. Express is a web application framework for Node.js that simplifies the creation of web servers and APIs. This is typically the first step in setting up a server to handle incoming webhooks. ```javascript const app = require('express')() ``` -------------------------------- ### GET /t/vbc.prod/vis/v1/self/calls/{id} Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/call/get-a-call_source=vonage-business-cloud Retrieves detailed information about a specific call using its unique identifier. ```APIDOC ## GET /t/vbc.prod/vis/v1/self/calls/{id} ### Description This endpoint retrieves detailed information about a specific call. ### Method GET ### Endpoint `/t/vbc.prod/vis/v1/self/calls/$id` ### Parameters #### Path Parameters - **id** (string) - Required - Unique identifier of the call. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/calls/$id' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **call_id** (string) - The unique identifier of the call. - **start_time** (string) - The timestamp when the call started. - **end_time** (string) - The timestamp when the call ended. - **duration** (integer) - The duration of the call in seconds. - **direction** (string) - The direction of the call (e.g., 'inbound', 'outbound'). - **from** (object) - Information about the caller. - **number** (string) - The phone number of the caller. - **to** (object) - Information about the recipient. - **number** (string) - The phone number of the recipient. #### Response Example ```json { "call_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "start_time": "2023-10-27T10:00:00Z", "end_time": "2023-10-27T10:05:30Z", "duration": 330, "direction": "outbound", "from": { "number": "+15551234567" }, "to": { "number": "+15557654321" } } ``` ``` -------------------------------- ### SDK Global Methods - placeCall Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/sdk-reference_source=vonage-business-cloud A shortcut to dialer instance's `placeCall` method. Use this when custom initialization is not feasible. Note: early calls may not be guaranteed. ```APIDOC ## placeCall (Global) ### Description Shortcut alias to dialer instance method placeCall (to be used when integration does not allow custom initialization). The result is not guaranteed if called too early. ### Method POST ### Endpoint /placeCall ### Parameters #### Request Body - **phoneNumber** (string) - Required - Phone number to dial. - **contactable** (entityRef) - Optional - A preferred contact to attach to interaction events. ### Request Example ```json { "phoneNumber": "+1234567890", "contactable": { "type": "contact", "id": "contact123" } } ``` ### Response #### Success Response (200) - **callId** (string) - The identifier for the placed call. #### Response Example ```json { "callId": "call_abc123" } ``` ``` -------------------------------- ### Get Account Devices - cURL Source: https://developer.vonage.com/en/vonage-business-cloud/telephony/code-snippets/device_registration/get-account-device-registration This snippet shows how to make a GET request to retrieve a list of devices associated with a specific Vonage Business Communications account. It requires an OAuth bearer token for authorization and the account ID. ```shell curl --location --request GET 'https://api.vonage.com/t/vbc.prod/telephony/v3/registration/accounts/$account_id/devices' \ --header 'Authorization: Bearer $bearer_token' ``` -------------------------------- ### Place a Call Programmatically with VonageDialer SDK Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/building-contactpad_source=vonage-business-cloud Initiates a phone call using the VonageDialer SDK. Ensure the user is logged into the dialer and has a working phone connection. This function should be called after VonageDialer.init() has completed. ```javascript VonageDialer.placeCall('+17328586962' /* optionally pass a preferred contact */ // , { // provider: 'acme', // id: '123', // label: 'John Smith', // type: 'contact' // } ); ``` -------------------------------- ### Get Events Count using cURL Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/event/get-events-count This snippet shows how to make a GET request to the Vonage Business Cloud API to retrieve the count of events. It requires an OAuth bearer token for authentication. The response will be a JSON object containing the event count. ```shell curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/events/count' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` -------------------------------- ### Call / Place a call Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/overview Initiates a new call. ```APIDOC ## POST /api/call/place ### Description Initiates a new call. ### Method POST ### Endpoint /api/call/place ### Parameters #### Request Body - **from** (string) - Required - The phone number to call from. - **to** (string) - Required - The phone number to call. ### Request Example ```json { "from": "+1234567890", "to": "+1098765432" } ``` ### Response #### Success Response (200) - **call_id** (string) - The unique identifier of the placed call. - **status** (string) - The initial status of the call (e.g., "ringing"). #### Response Example ```json { "call_id": "call_xyz789uvw", "status": "ringing" } ``` ``` -------------------------------- ### Create Vonage Application CLI Source: https://developer.vonage.com/en/vonage-business-cloud/smart-numbers/code-snippets/vbc-receive-inbound-call_source=vonage-business-cloud Command to create a new Vonage application with a specified name. This generates a private key and sets up the application, but does not enable capabilities initially. ```bash vonage apps create 'Your application' ``` -------------------------------- ### Get Events Count API Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/event/get-events-count This endpoint retrieves the count of events. It requires an OAuth token for authentication. ```APIDOC ## GET /t/vbc.prod/vis/v1/self/events/count ### Description Retrieves the total count of events associated with the authenticated user. ### Method GET ### Endpoint `/t/vbc.prod/vis/v1/self/events/count` ### Parameters #### Query Parameters None #### Header Parameters - **Authorization** (string) - Required - Bearer token for authentication. Example: `Bearer $bearer_token` - **Content-Type** (string) - Required - Specifies the content type of the request. Example: `application/json` ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/events/count' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **count** (integer) - The total number of events. #### Response Example ```json { "count": 150 } ``` ``` -------------------------------- ### GET /t/vbc.prod/vis/v1/self/events/:id Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/event/get-an-event Retrieves the details of a specific event using its unique identifier. Requires an OAuth token for authentication. ```APIDOC ## GET /t/vbc.prod/vis/v1/self/events/:id ### Description Retrieves the details of a specific event using its unique identifier. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/vis/v1/self/events/:id` ### Parameters #### Path Parameters - **id** (string) - Required - Unique identifier of the event #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/events/:id' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **event_details** (object) - Contains detailed information about the event. #### Response Example ```json { "event_id": "unique_event_id", "event_type": "meeting", "timestamp": "2023-10-27T10:00:00Z", "duration": 3600, "participants": [ "user1@example.com", "user2@example.com" ] } ``` ``` -------------------------------- ### SDK Dialer Instance Methods - placeCall Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/sdk-reference_source=vonage-business-cloud Initiates a phone call using the dialer instance. Optionally, a contact can be provided to associate with the call events. ```APIDOC ## placeCall (Instance) ### Description Place a call. ### Method POST ### Endpoint /dialer/placeCall ### Parameters #### Request Body - **phoneNumber** (string) - Required - Phone number to dial. - **contactable** (entityRef) - Optional - Optionally pass a preferred contact to be attached to the interaction events. ### Request Example ```json { "phoneNumber": "+1987654321", "contactable": { "type": "contact", "id": "contact456" } } ``` ### Response #### Success Response (200) - **callId** (string) - The identifier for the placed call. #### Response Example ```json { "callId": "call_def456" } ``` ``` -------------------------------- ### GET /telephony/v3/cc/accounts/{account_id}/calls/{call_id} Source: https://developer.vonage.com/en/vonage-business-cloud/telephony/code-snippets/call/get-details-for-call_source=vonage-business-cloud Fetches details for a specific call, including its legs, direction (inbound or outbound), and status. ```APIDOC ## GET /telephony/v3/cc/accounts/{account_id}/calls/{call_id} ### Description Retrieves details for a specific call. This endpoint returns information about the call legs, direction (inbound or outbound), and status of the call. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/telephony/v3/cc/accounts/$account_id/calls/$call_id` ### Parameters #### Path Parameters - **account_id** (string) - Required - The Vonage Business Communications account ID. - **call_id** (string) - Required - The ID of the call for which to retrieve details. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/telephony/v3/cc/accounts/$account_id/calls/$call_id' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **call_id** (string) - The unique identifier for the call. - **account_id** (string) - The account ID associated with the call. - **legs** (array) - An array of call leg objects. - **leg_id** (string) - The unique identifier for the call leg. - **direction** (string) - The direction of the call leg (inbound or outbound). - **status** (string) - The status of the call leg (e.g., completed, in-progress, failed). - **start_time** (string) - The timestamp when the call leg started. - **end_time** (string) - The timestamp when the call leg ended. - **start_time** (string) - The timestamp when the call was initiated. - **end_time** (string) - The timestamp when the call ended. #### Response Example ```json { "call_id": "abcdef12-3456-7890-abcd-ef1234567890", "account_id": "12345678-abcd-1234-abcd-1234567890ab", "legs": [ { "leg_id": "leg-12345", "direction": "inbound", "status": "completed", "start_time": "2023-10-27T10:00:00Z", "end_time": "2023-10-27T10:05:00Z" }, { "leg_id": "leg-67890", "direction": "outbound", "status": "completed", "start_time": "2023-10-27T10:01:00Z", "end_time": "2023-10-27T10:04:00Z" } ], "start_time": "2023-10-27T10:00:00Z", "end_time": "2023-10-27T10:05:00Z" } ``` ``` -------------------------------- ### Get Company Call Recordings CSP(India) Source: https://developer.vonage.com/en/vonage-business-cloud/call-recording-india/code-snippets/company-call-recording-india/get-company-call-recordings Retrieves call recordings for a given CSP(India) account. ```APIDOC ## GET /accounts/{account_id}/company_call_recordings ### Description Retrieves company call recordings for a CSP(India) account. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/call_recording_india/api/accounts/$account_id/company_call_recordings` ### Parameters #### Path Parameters - **account_id** (string) - Required - The Vonage Business Communications CSP(India) account ID. Use 'self' to refer to the authenticated user's account. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/call_recording_india/api/accounts/$account_id/company_call_recordings' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **recordings** (array) - A list of call recording objects. - **recording_id** (string) - The ID of the call recording. - **call_id** (string) - The ID of the call. - **start_time** (string) - The start time of the call. - **end_time** (string) - The end time of the call. - **duration** (integer) - The duration of the call in seconds. - **audio_url** (string) - The URL to access the call recording audio. #### Response Example ```json { "recordings": [ { "recording_id": "some_recording_id", "call_id": "some_call_id", "start_time": "2023-10-27T10:00:00Z", "end_time": "2023-10-27T10:05:00Z", "duration": 300, "audio_url": "https://example.com/recordings/some_recording_id.mp3" } ] } ``` ``` -------------------------------- ### Initialize Vonage Dialer Instance Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/sdk-reference_source=vonage-business-cloud Initializes the Vonage dialer instance with optional configuration and provides a callback with the dialer object. This is crucial for interacting with the SDK's functionalities. ```javascript VonageDialer.init({ debug: true }, (dialer) => { dialer // <- dialer instance }); ``` -------------------------------- ### Application Creation and Configuration Source: https://developer.vonage.com/en/vonage-business-cloud/smart-numbers/code-snippets/vbc-receive-inbound-call This section details the steps to create a Vonage application and enable voice capabilities, including setting webhook URLs. ```APIDOC ## Create Vonage Application ### Description Creates a new Vonage application with a specified name. ### Method `vonage apps create` ### Parameters - **Name** (string) - Required - The name for your application. ### Example ```bash vonage apps create 'Your application' ``` ## Update Application Capabilities ### Description Adds voice capabilities to an existing Vonage application and configures webhook URLs. ### Method `vonage apps capabilities update` ### Parameters - **Application ID** (string) - Required - The ID of the application to update. - **voice-answer-url** (string) - Required - The URL for handling incoming call answers. - **voice-event-url** (string) - Required - The URL for receiving call events. - **voice-fallback-url** (string) - Required - The fallback URL for call events. ### Example ```bash vonage apps capabilities update 00000000-0000-0000-0000-000000000000 voice \ --voice-answer-url='https://example.com/webhooks/voice/answer' \ --voice-event-url='https://example.com/webhooks/voice/event' \ --voice-fallback-url='https://example.com/webhooks/voice/fallback' ``` ``` -------------------------------- ### Get Active Calls Count using curl Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/call/get-calls-count This snippet demonstrates how to make a GET request to the Vonage Business Cloud API to retrieve the count of active calls. It requires an OAuth bearer token for authorization and specifies the content type as JSON. The endpoint used is '/t/vbc.prod/vis/v1/self/calls/count'. ```curl curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/calls/count' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` -------------------------------- ### GET /t/vbc.prod/vis/v1/self/webhooks Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/webhook/list-webhooks Demonstrates how to list webhooks by making a GET request to the specified endpoint. It requires an OAuth token for authorization. ```APIDOC ## GET /t/vbc.prod/vis/v1/self/webhooks ### Description This endpoint allows you to retrieve a list of all configured webhooks for your account. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/vis/v1/self/webhooks` ### Parameters #### Header Parameters - **Authorization** (string) - Required - Your OAuth token in the format "Bearer YOUR_TOKEN". - **Content-Type** (string) - Required - Must be set to "application/json". ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/webhooks' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **webhooks** (array) - A list of webhook objects. - **uuid** (string) - The unique identifier for the webhook. - **event_url** (string) - The URL where webhook events will be sent. - **event_type** (string) - The type of event the webhook is configured for. - **status** (string) - The status of the webhook (e.g., 'ACTIVE', 'INACTIVE'). #### Response Example ```json { "webhooks": [ { "uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "event_url": "https://example.com/webhook", "event_type": "call.answered", "status": "ACTIVE" } ] } ``` ``` -------------------------------- ### VonageDialer Initialization Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/customizations Initializes the Vonage Dialer with specified features enabled. ```APIDOC ## VonageDialer Initialization ### Description Initializes the Vonage Dialer and enables specific features for the user interface. You must also implement the corresponding handlers for the enabled features. ### Method `VonageDialer.init(options, callback)` ### Parameters #### Request Body - **options** (object) - Configuration object for the dialer. - **features** (object) - An object to specify which features to enable. - **contactsProvider** (boolean) - Enable contacts provider. - **openContact** (boolean) - Enable open contact functionality. - **openActivity** (string) - Specify the integration provider for open activity. - **eventsHistory** (boolean) - Enable events history. - **callback** (function) - Callback function that receives the dialer instance. ### Request Example ```javascript VonageDialer.init({ features: { contactsProvider: true, openContact: true, openActivity: 'acme', eventsHistory: true } }, (dialer) => { /* dialer instance */ }); ``` ### Response #### Success Response (Callback) - **dialer** (object) - The dialer instance provided to the callback function. ``` -------------------------------- ### Get Call Details Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/code-snippets/call/get-a-call Retrieves detailed information about a specific call using its unique identifier. Requires an OAuth token for authentication. ```APIDOC ## GET /t/vbc.prod/vis/v1/self/calls/{id} ### Description Retrieves detailed information about a specific call using its unique identifier. ### Method GET ### Endpoint `/t/vbc.prod/vis/v1/self/calls/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - Unique identifier of the call #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/vis/v1/self/calls/$id' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **response_body** (object) - Detailed information about the call. The exact structure depends on the API. #### Response Example ```json { "example": "Call details object" } ``` ``` -------------------------------- ### SDK Global Methods - setProvider Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/sdk-reference_source=vonage-business-cloud Allows switching between CC (Call Center) and UC (Unified Communications) providers after the dialer interface is loaded. ```APIDOC ## setProvider ### Description Allows switching the provider (CC/UC) after the dialer interface is loaded. ### Method POST ### Endpoint /setProvider ### Parameters #### Request Body - **provider** (string) - Required - Either 'cc' or 'uc'. - 'cc' loads Vonage Call Center ContactPad. - 'uc' loads Vonage Business Communications ContactPad. - **ccDomain** (string) - Optional - Use a custom VCC region domain (e.g., 'nam.newvoicemedia.com'). - **ccAccount** (string) - Optional - Use a custom VCC account name. ### Request Example ```json { "provider": "cc", "ccDomain": "emea.newvoicemedia.com" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### GET /accounts/{account_id}/locations/{location_id} Source: https://developer.vonage.com/en/vonage-business-cloud/provisioning/code-snippets/account/get-location-data-account-id-location-id Retrieves the physical location data for a specified account and location. ```APIDOC ## GET /accounts/{account_id}/locations/{location_id} ### Description This endpoint retrieves the physical location of an account using the provided account ID and location ID. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/provisioning/v1/api/accounts/$account_id/locations/$location_id` ### Parameters #### Path Parameters - **account_id** (string) - Required - The Vonage Business Communications account ID. - **location_id** (string) - Required - The location ID. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/provisioning/v1/api/accounts/$account_id/locations/$location_id' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) - **address** (object) - The address details of the location. - **street_address** (string) - The street address. - **locality** (string) - The city or locality. - **region** (string) - The state or region. - **postal_code** (string) - The postal code. - **country** (string) - The country. - **description** (string) - A description of the location. #### Response Example ```json { "address": { "street_address": "123 Main St", "locality": "Anytown", "region": "CA", "postal_code": "90210", "country": "USA" }, "description": "Primary Office Location" } ``` ``` -------------------------------- ### Account / Get account info Source: https://developer.vonage.com/en/vonage-business-cloud/vonage-integration-platform/overview Retrieves information about the current account. ```APIDOC ## GET /api/account ### Description Retrieves information about the current account. ### Method GET ### Endpoint /api/account ### Parameters #### Query Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **account_id** (string) - The unique identifier for the account. - **account_name** (string) - The name of the account. #### Response Example ```json { "account_id": "acc_12345abc", "account_name": "My Business Account" } ``` ``` -------------------------------- ### GET /call_recording/api/accounts/:account_id/users/:user_id/call_recordings/:recording_id Source: https://developer.vonage.com/en/vonage-business-cloud/call-recording/code-snippets/on-demand-call-recording/get-single-on-demand-call-recording Retrieves a specific on-demand call recording for a given account and user. ```APIDOC ## GET /call_recording/api/accounts/:account_id/users/:user_id/call_recordings/:recording_id ### Description Retrieves a specific on-demand call recording for a given account and user. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/call_recording/api/accounts/:account_id/users/:user_id/call_recordings/:recording_id` ### Parameters #### Path Parameters - **account_id** (string) - Required - The Vonage Business Communications account ID. Use 'self' to refer to the authenticated user's account. - **user_id** (string) - Required - The Vonage Business Communications user ID. Use 'self' to refer to the authenticated user. - **recording_id** (string) - Required - The ID of the call recording to retrieve. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/call_recording/api/accounts/self/users/self/call_recordings/YOUR_RECORDING_ID' \ --header 'Authorization: Bearer YOUR_BEARER_TOKEN' ``` ### Response #### Success Response (200) - **recording_data** (object) - Contains the call recording details. - **recording_id** (string) - The ID of the recording. - **start_time** (string) - The start time of the call. - **end_time** (string) - The end time of the call. - **duration** (integer) - The duration of the call in seconds. - **media_url** (string) - The URL to access the call recording media. #### Response Example ```json { "recording_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "start_time": "2023-10-27T10:00:00Z", "end_time": "2023-10-27T10:05:30Z", "duration": 330, "media_url": "https://storage.vonage.com/recordings/a1b2c3d4-e5f6-7890-1234-567890abcdef.mp3" } ``` ``` -------------------------------- ### Dialer Configuration API Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/sdk-reference_source=vonage-business-cloud Configuration options for the SDK init method, allowing customization of debug mode, provider, and specific settings for Call Center (CC) and Unified Communications (UC). ```APIDOC ## Dialer Configuration (`dialerConfig`) Configuration options for SDK init method. ### Properties - **debug** (boolean) - Print extra debug information in the browser JS console. Defaults to `false`. - **provider** (string) - Specifies the dialer interface to load. Options: `"cc"` or `"uc"`. Defaults to `"uc"`. - `"cc"`: Loads Vonage Call Center ContactPad as a dialer interface (/VCC/). - `"uc"`: Loads Vonage Integration Platform (VGIP) as a dialer interface (/VBC, VBE/). - **ccDomain** (string, CC only) - Use a custom VCC region domain. Well-known options include: - `nam.newvoicemedia.com` (default) - `emea.newvoicemedia.com` - `apac.newvoicemedia.com` - **ccAccount** (optional, string, CC only) - Use a custom VCC account name. - **features** (dialerFeatures, UC only) - Customize UC dialer interface (show/hide extra UI controls). ``` -------------------------------- ### GET /telephony/v3/registration/accounts/{account_id}/devices/{device_id} Source: https://developer.vonage.com/en/vonage-business-cloud/telephony/code-snippets/device_registration/get-device-registration-info Retrieves the details of a specific registered device within a Vonage Business Communications account. ```APIDOC ## GET /telephony/v3/registration/accounts/{account_id}/devices/{device_id} ### Description This endpoint allows you to retrieve the registration details for a specific device associated with your Vonage Business Communications account. You will need to provide your account ID and the device's MAC address. ### Method GET ### Endpoint `https://api.vonage.com/t/vbc.prod/telephony/v3/registration/accounts/$account_id/devices/$device_id` ### Parameters #### Path Parameters - **account_id** (string) - Required - The Vonage Business Communications account ID. - **device_id** (string) - Required - The MAC address of the device. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://api.vonage.com/t/vbc.prod/telephony/v3/registration/accounts/$account_id/devices/$device_id' \ --header 'Authorization: Bearer $bearer_token' ``` ### Response #### Success Response (200) * **field1** (type) - Description (Example structure not provided in source text) #### Response Example (No specific success response example provided in the source text) ``` -------------------------------- ### Place a Call Programmatically with Open ContactPad SDK Source: https://developer.vonage.com/en/vonage-business-cloud/open-contactpad/building-contactpad Initiates a phone call using the Vonage Dialer. This function requires the user to be logged into the dialer with a connected soft or hardware phone. It should be called after the VonageDialer.init() callback to ensure the interface is loaded. ```javascript VonageDialer.placeCall('+17328586962' // , { // provider: 'acme', // id: '123', // label: 'John Smith', // type: 'contact' // } ); ```