Vonage JWT - Vonage/vonage-node-sdk GitHub Wiki
Documentation / Vonage JWT
This is the Vonage Applications SDK for Node.js for use with Vonage APIs. To use it you will need a Vonage account. Sign up for free at vonage.com.
For full API documentation refer to developer.nexmo.com.
If you are updating from V2 to V3, please check the migration guide found here
We recommend using this SDK as part of the overall @vonage/server-sdk
package. Please see the main package for installation.
You can also use this SDK standalone if you only need access to just the Applications API.
npm install @vonage/applications
yarn add @vonage/applications
If you are using this SDK as part of the Vonage Server SDK, you can access it
as the applications
property off of the client that you instantiate.
const { Vonage } = require('@vonage/server-sdk');
const vonage = new Vonage({
apiKey: API_KEY,
apiSecret: API_SECRET,
}, options);
const balance = await vonage.applications.listApplications();
The SDK can be used standalone from the main Vonage Server SDK for Node.js if you only need to use the Applications API. All you need to do is require('@vonage/applications')
, and use the returned object to create your own client.
const { Auth } = require('@vonage/auth');
const { Applications } = require('@vonage/applications');
const credentials = new Auth({
apiKey: API_KEY,
apiSecret: API_SECRET,
});
const options = { timeout: 1500 };
const applicationsClient = new Applications(credentials, options);
Where credentials
is any option from @vonage/auth
, and options
is any option from @vonage/server-client
Most methods that interact with the Vonage API use Promises. You can either resolve these yourself or use await
to wait for a response.
const applications = await applicationsClient.listApplications();
applicationsClient.listApplications()
.then(resp => console.log(resp))
.catch(err => console.error(err));
Run:
npm run test
A library to allow management of your Vonage Applications.
A Vonage API application contains the security and configuration information you need to connect to Vonage endpoints and use the Vonage APIs. Each Vonage application created can support multiple capabilities - for example you can create an Application that supports using the Voice, Messages and RTC APIs.
https://developer.vonage.com/en/application/overview
Defined in: applications/lib/enums/VoiceRegions.ts:9
Enumeration representing different voice regions.
Selecting a region means all inbound, programmable SIP and SIP connect calls will be sent to the selected region unless the call is sent to a regional endpoint. If the call is using a regional endpoint this will override the application setting.
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
APAC_AUSTRALIA
|
"apac-australia" |
Description Asia-Pacific - Australia region | applications/lib/enums/VoiceRegions.ts:38 |
APAC_SNG
|
"apac-sng" |
Description Asia-Pacific - Singapore region | applications/lib/enums/VoiceRegions.ts:33 |
EU_EAST
|
"eu-east" |
Description Europe - East region | applications/lib/enums/VoiceRegions.ts:28 |
EU_WEST
|
"eu-west" |
Description Europe - West region | applications/lib/enums/VoiceRegions.ts:23 |
NA_EAST
|
"na-east" |
Description North America - East region | applications/lib/enums/VoiceRegions.ts:13 |
NA_WEST
|
"na-west" |
Description North America - West region | applications/lib/enums/VoiceRegions.ts:18 |
Defined in: applications/lib/applications.ts:57
new Applications(credentials, options?): Applications;
Defined in: server-client/dist/lib/client.d.ts:35
Creates a new instance of the Client.
The authentication credentials or an authentication instance.
Optional configuration settings for the client.
protected auth: AuthInterface;
Defined in: server-client/dist/lib/client.d.ts:24
The authentication instance responsible for generating authentication headers and query parameters.
authType: AuthenticationType = AuthenticationType.BASIC;
Defined in: applications/lib/applications.ts:58
The type of authentication used for the client's requests.
protected config: ConfigParams;
Defined in: server-client/dist/lib/client.d.ts:28
Configuration settings for the client, including default hosts for various services and other request settings.
static transformers: object;
Defined in: server-client/dist/lib/client.d.ts:11
Static property containing utility transformers.
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys: PartialTransformFunction;
omit: (keys, obj) => TransformedObject;
string
[]
snakeCaseObjectKeys: PartialTransformFunction;
addAuthenticationToRequest(request): Promise<VetchOptions>;
Defined in: server-client/dist/lib/client.d.ts:43
Adds the appropriate authentication headers or parameters to the request based on the authentication type.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addAuthenticationToRequest
protected addBasicAuthToRequest(request): Promise<VetchOptions>;
Defined in: server-client/dist/lib/client.d.ts:71
Adds basic authentication headers to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
protected addJWTToRequest(request): Promise<VetchOptions>;
Defined in: server-client/dist/lib/client.d.ts:64
Adds a JWT to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>;
Defined in: server-client/dist/lib/client.d.ts:57
Adds API key and secret to the request.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequest
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>;
Defined in: server-client/dist/lib/client.d.ts:50
Adds API key and secret to the request body.
The request options to which authentication needs to be added.
Promise
<VetchOptions
>
- The request options with the added authentication.
Client
.addQueryKeySecretToRequestBody
createApplication(application): Promise<MergedApplication>;
Defined in: applications/lib/applications.ts:205
Creates a new application with the provided details.
The application details to be created.
Promise
<MergedApplication
>
- A promise resolving to the created application.
API Specification https://developer.vonage.com/en/api/application.v2#createApplication
Create a new application
const application = await applicationClient.createApplication({
name: 'My Application',
capabilities: {
voice: {
webhooks: {
answerUrl: {
address: 'https://example.com/answer',
httpMethod: 'GET'
},
eventUrl: {
address: 'https://example.com/event',
httpMethod: 'POST'
}
}
}
}
});
console.log(application.id);
deleteApplication(applicationId): Promise<void>;
Defined in: applications/lib/applications.ts:286
Deletes an application by its unique identifier.
string
The unique identifier of the application to delete.
Promise
<void
>
- A promise indicating the successful deletion of the application.
API Specification https://developer.vonage.com/en/api/application.v2#deleteApplication
Delete an application
await applicationClient.deleteApplication(APPLICATION_ID);
getApplication(applicationId): Promise<MergedApplication>;
Defined in: applications/lib/applications.ts:232
Retrieves an application by its unique identifier.
string
The unique identifier of the application to retrieve.
Promise
<MergedApplication
>
- A promise resolving to the retrieved application.
API Specification https://developer.vonage.com/en/api/application.v2#getApplication
Retrieve an application
const application = await applicationClient.getApplication(APPLICATION_ID);
console.log(application.name);
getApplicationPage(filter): Promise<ApplicationPageList>;
Defined in: applications/lib/applications.ts:151
Retrieves a page of applications based on filter parameters.
The filter parameters for pagination.
Promise
<ApplicationPageList
>
- A promise resolving to a page of applications.
This will return the snake_case
and the camelCase
response. Using
snake_case
is considered deprecated
API Specification https://developer.vonage.com/en/api/application.v2#listApplication
Get a single page of applications
const applications = await applicationClient.getApplicationPage({
page: 1,
size: 10
});
applications.applications.forEach(application => {
console.log(application.name);
});
getConfig(): ConfigParams;
Defined in: server-client/dist/lib/client.d.ts:36
listAllApplications(params?): AsyncGenerator<MergedApplication, void & Application & object & APILinks, undefined>;
Defined in: applications/lib/applications.ts:111
Retrieves all applications, iterating over paginated results.
Optional filter parameters.
AsyncGenerator
<MergedApplication
, void
& Application
& object
& APILinks
, undefined
>
- An asynchronous generator.
This will keep calling the API until there are no pages left. This will
return the snake_case
and the camelCase
response. Using snake_case
is considered deprecated
- Yields application items.
List applications with pagination using an iterator
for await (const application of applicationClient.listAllApplications()) {
console.log(application.name);
}
listApplications(params): Promise<ApplicationPageList>;
Defined in: applications/lib/applications.ts:84
Retrieves a list of applications with optional pagination parameters.
The filter parameters.
Promise
<ApplicationPageList
>
- A promise resolving to the list of applications.
This is used to get a specific page of applications. This will
return the snake_case
and the camelCase
response. Using snake_case
is considered deprecated
API Specification https://developer.vonage.com/en/api/application.v2#listApplication
List a single page of applications
const applications = await applicationClient.listApplications({});
applications.applications.forEach(application => {
console.log(application.name);
});
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:168
Parses the response based on its content type.
T
The expected type of the parsed response data.
The request options.
Response
The raw response from the request.
Promise
<VetchResponse
<T
>>
- The parsed response.
protected prepareBody(request): undefined | string;
Defined in: server-client/dist/lib/client.d.ts:158
Prepares the body for the request based on the content type.
The request options.
undefined
| string
- The prepared request body as a string or undefined.
protected prepareRequest(request): Promise<VetchOptions>;
Defined in: server-client/dist/lib/client.d.ts:151
Prepares the request with necessary headers, authentication, and query parameters.
The initial request options.
Promise
<VetchOptions
>
- The modified request options.
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:78
Sends a DELETE request to the specified URL.
T
string
The URL endpoint for the DELETE request.
Promise
<VetchResponse
<T
>>
- The response from the DELETE request.
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:86
Sends a POST request with form data to the specified URL.
T
string
The URL endpoint for the POST request.
Record
<string
, undefined
| string
>
Optional payload containing form data to send with the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:94
Sends a GET request to the specified URL with optional query parameters.
T
string
The URL endpoint for the GET request.
Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.
Promise
<VetchResponse
<T
>>
- The response from the GET request.
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:104
Sends a PATCH request to the specified URL with an optional payload.
T
string
The URL endpoint for the PATCH request.
Optional payload to be sent as the body of the PATCH request.
Promise
<VetchResponse
<T
>>
- The response from the PATCH request.
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:114
Sends a POST request to the specified URL with an optional payload.
T
string
The URL endpoint for the POST request.
Optional payload to be sent as the body of the POST request.
Promise
<VetchResponse
<T
>>
- The response from the POST request.
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:124
Sends a PUT request to the specified URL with an optional payload.
T
string
The URL endpoint for the PUT request.
Optional payload to be sent as the body of the PUT request.
Promise
<VetchResponse
<T
>>
- The response from the PUT request.
sendRequest<T>(request): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:144
Sends a request adding necessary headers, handling authentication, and parsing the response.
T
The options defining the request, including URL, method, headers, and data.
Promise
<VetchResponse
<T
>>
- The parsed response from the request.
sendRequestWithData<T>(
method,
url,
payload?): Promise<VetchResponse<T>>;
Defined in: server-client/dist/lib/client.d.ts:135
Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.
T
The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).
string
The URL endpoint for the request.
Optional payload to be sent as the body of the request, JSON-encoded.
Promise
<VetchResponse
<T
>>
- The response from the request.
updateApplication(application): Promise<MergedApplication>;
Defined in: applications/lib/applications.ts:261
Updates an existing application with the provided details.
The application details to be updated.
Promise
<MergedApplication
>
- A promise resolving to the updated application.
API Specification https://developer.vonage.com/en/api/application.v2#updateApplication
Update an application
const application = await applicationClient.updateApplication({
id: APPLICATION_ID,
name: 'My Application',
});
console.log(application.name);
type AnswerCallbackUrl = object & CapabilityWebhook;
Defined in: applications/lib/types/CapabilityVoice.ts:8
Vonage numbers that are linked to Vonage applications will use the answer_url to retrieve an NCCO
optional connectTimeout: number;
Connection timeout in milliseconds.
optional socketTimeout: number;
Socket timeout in milliseconds.
type AnswerUrlResponse = object & CapabilityWebhookResponse;
Defined in: applications/lib/types/Response/CapabilityVoiceResponse.ts:33
Answer URL configuration response
optional connect_timeout: number;
Connection timeout in milliseconds.
optional socket_timeout: number;
Socket timeout in milliseconds.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type AnyCapability =
| CapabilityBulk
| CapabilityMeetings
| CapabilityMessages
| CapabilityRTC
| CapabilityVerify
| CapabilityVoice
| CapabilityWebhook;
Defined in: applications/lib/types/index.ts:9
type Application = object;
Defined in: applications/lib/types/Application.ts:11
Represents an application configuration.
capabilities: object;
Defined in: applications/lib/types/Application.ts:65
Represents the capabilities configuration for an application.
optional bulk: CapabilityBulk;
Bulk related configuration.
optional meetings: CapabilityMeetings;
Meetings related configuration.
optional messages: CapabilityMessages;
Messages/Dispatch related configuration.
optional rtc: CapabilityRTC;
RTC/Conversation Service related configuration.
optional vbc: unknown;
Specify the vbc capability to enable zero-rated calls for VBC number programmability service applications. This is always an empty object.
optional verify: CapabilityVerify;
Verify related configuration.
optional voice: CapabilityVoice;
Voice related configuration.
optional id: string;
Defined in: applications/lib/types/Application.ts:15
The application's unique ID.
optional keys: object;
Defined in: applications/lib/types/Application.ts:29
Represents the keys associated with an application.
optional privateKey: string;
The private key for the application.
This will only be present when the application is created, or when you cycle the public key when doing an update.
optional publicKey: string;
The public key for the application.
You can find this value in your Vonage developer dashboard [https://dashboard.nexmo.com/applications]
name: string;
Defined in: applications/lib/types/Application.ts:23
Friendly identifier for the application.
This is not unique.
optional privacy: object;
Defined in: applications/lib/types/Application.ts:51
Represents the privacy configuration for an application
improveAi: boolean;
Share content
If set to true, Vonage may store and use your content and data for the improvement of Vonage's AI-based services and technologies.
type ApplicationPageList = object & ApplicationPageResponse;
Defined in: applications/lib/types/ApplicationPageList.ts:6
Represents a paginated list of applications.
pageSize: number;
The number of applications per page.
totalItems: number;
The total number of applications.
totalPages: number;
The total number of pages returned.
type ApplicationPageResponse = object & APILinks;
Defined in: applications/lib/types/Response/ApplicationPageResponse.ts:13
Represents the response for a paginated list of applications.
_embedded: object;
An object containing a list of applications.
_embedded.applications: ApplicationResponse[];
A list of applications matching your existing filters.
applications: ApplicationResponse[];
A list of applications matching your existing filters.
page: number;
The current page number (starts at 1).
page_size: number;
The number of applications per page.
total_items: number;
The total number of applications.
total_pages: number;
The total number of pages returned.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
https://developer.vonage.com/en/api/application.v2#listApplication
type ApplicationResponse = object & Application & APILinks;
Defined in: applications/lib/types/Response/ApplicationResponse.ts:21
Represents a response containing application information.
capabilities: object;
Capabilities configuration for the application.
capabilities.bulk: CapabilityBulkResponse;
Bulk related configuration.
capabilities.meetings: CapabilityMeetingsResponse;
Meetings related configuration.
capabilities.messages: CapabilityMessagesResponse;
Messages/Dispatch related configuration.
capabilities.rtc: CapabilityRTCResponse;
RTC/Conversation Service related configuration.
capabilities.vbc: unknown;
Specify the vbc capability to enable zero-rated calls for VBC number programmability service applications. This is always an empty object.
capabilities.verify: CapabilityVerifyResponse;
Verify related configuration.
capabilities.voice: CapabilityVoiceResponse;
Voice related configuration.
keys: object;
Keys associated with the application.
optional keys.private_key: string;
The private key for the application.
optional keys.public_key: string;
The public key for the application.
privacy: object;
Privacy configuration for the application.
optional privacy.improve_ai: boolean;
If set to true, Vonage may store and use your content and data for the improvement of Vonage's AI-based services and technologies.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
https://developer.vonage.com/en/api/application.v2#getApplication
type CapabilityBulk = object;
Defined in: applications/lib/types/CapabilityBulk.ts:6
Represents a bulk capability configuration containing webhooks.
webhooks: object;
Defined in: applications/lib/types/CapabilityBulk.ts:10
Webhook configuration for proactive-connect related events.
listStatusUrl: CapabilityWebhook;
URL for listing status related to bulk operations.
runStatusUrl: CapabilityWebhook;
URL for running status related to bulk operations.
type CapabilityBulkResponse = object;
Defined in: applications/lib/types/Response/CapabilityBulkResponse.ts:10
Represents the response for bulk-related capabilities configuration.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
webhooks: object;
Defined in: applications/lib/types/Response/CapabilityBulkResponse.ts:14
Webhook configuration for bulk events.
list_status_url: CapabilityWebhookResponse;
Webhook for events related to bulk list status.
run_status_url: CapabilityWebhookResponse;
Webhook for events related to bulk run status.
type CapabilityMeetings = object;
Defined in: applications/lib/types/CapabilityMeetings.ts:6
Represents the meetings-related capabilities configuration for an application.
webhooks: object;
Defined in: applications/lib/types/CapabilityMeetings.ts:10
Webhook configuration for meetings-related events.
recordingChanged: CapabilityWebhook;
Webhook for events related to changes in meeting recording.
roomChanged: CapabilityWebhook;
Webhook for events related to changes in meeting rooms.
sessionChanged: CapabilityWebhook;
Webhook for events related to changes in meeting sessions.
type CapabilityMeetingsResponse = object;
Defined in: applications/lib/types/Response/CapabilityMeetingsResponse.ts:10
Represents the response for meetings-related capabilities configuration.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
webhooks: object;
Defined in: applications/lib/types/Response/CapabilityMeetingsResponse.ts:14
Webhook configuration for meetings-related events.
recording_changed: CapabilityWebhookResponse;
Webhook for events related to changes in meeting recording.
room_changed: CapabilityWebhookResponse;
Webhook for events related to changes in meeting rooms.
session_changed: CapabilityWebhookResponse;
Webhook for events related to changes in meeting sessions.
type CapabilityMessages = object;
Defined in: applications/lib/types/CapabilityMessages.ts:6
Represents a configuration for messaging capabilities.
authenticateInboundMedia: boolean;
Defined in: applications/lib/types/CapabilityMessages.ts:30
Whether to authenticate inbound media.
version: "v1" | "v0.1";
Defined in: applications/lib/types/CapabilityMessages.ts:25
The version of messaging capabilities ('v1' or 'v0.1').
webhooks: object;
Defined in: applications/lib/types/CapabilityMessages.ts:10
Webhook configuration for inbound messages.
inboundUrl: CapabilityWebhook;
URL for handling inbound messages.
statusUrl: CapabilityWebhook;
URL for handling message status events.
type CapabilityMessagesResponse = object & Omit<CapabilityMessages, "version" | "webhooks" | "authenticateInboundMedia">;
Defined in: applications/lib/types/Response/CapabilityMessagesResponse.ts:11
Represents the response for messages-related capabilities configuration.
authenticate_inbound_media: boolean;
Whether to authenticate inbound media for messages.
webhooks: object;
Webhook configuration for messages-related events.
webhooks.inbound_url: CapabilityWebhookResponse;
Webhook for inbound messages.
webhooks.status_url: CapabilityWebhookResponse;
Webhook for events related to message status.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type CapabilityRTC = object;
Defined in: applications/lib/types/CapabilityRTC.ts:6
Represents a configuration for RTC (Real-Time Communication) capabilities.
legPersistenceTime: number;
Defined in: applications/lib/types/CapabilityRTC.ts:25
The leg persistence time for RTC in milliseconds.
signedCallbacks: boolean;
Defined in: applications/lib/types/CapabilityRTC.ts:20
Whether to use signed callbacks for RTC.
webhooks: object;
Defined in: applications/lib/types/CapabilityRTC.ts:10
Webhook configuration for RTC events.
eventUrl: CapabilityWebhook;
URL for handling RTC events.
type CapabilityRTCResponse = object;
Defined in: applications/lib/types/Response/CapabilityRTCResponse.ts:10
Represents the response for RTC-related capabilities configuration.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
leg_persistence_time: number;
Defined in: applications/lib/types/Response/CapabilityRTCResponse.ts:29
The leg persistence time for RTC events.
signed_callbacks: boolean;
Defined in: applications/lib/types/Response/CapabilityRTCResponse.ts:24
Whether to use signed webhooks for RTC events.
webhooks: object;
Defined in: applications/lib/types/Response/CapabilityRTCResponse.ts:14
Webhook configuration for RTC events.
event_url: CapabilityWebhookResponse;
Webhook for events related to RTC.
type CapabilityVerify = object;
Defined in: applications/lib/types/CapabilityVerify.ts:6
Represents a configuration for verification capabilities.
version: "v2";
Defined in: applications/lib/types/CapabilityVerify.ts:20
The version of verification capabilities ('v2').
webhooks: object;
Defined in: applications/lib/types/CapabilityVerify.ts:10
Webhook configuration for verification status events.
statusUrl: CapabilityWebhook;
URL for handling verification status events.
type CapabilityVerifyResponse = object & Omit<CapabilityVerify, "webhooks">;
Defined in: applications/lib/types/Response/CapabilityVerifyResponse.ts:11
Represents the response for verification-related capabilities configuration.
webhooks: object;
Webhook configuration for verification events.
webhooks.status_url: CapabilityWebhookResponse;
Webhook for events related to verification status.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type CapabilityVoice = object;
Defined in: applications/lib/types/CapabilityVoice.ts:61
Represents the voice-related capabilities configuration for an application.
https://developer.vonage.com/en/getting-started/concepts/webhooks?lang=voice
optional conversationsTTL: number;
Defined in: applications/lib/types/CapabilityVoice.ts:100
Conversation TTL
The length of time named conversations will remain active for after creation, in hours. 0 means infinite. Maximum value is 744 (i.e., 31 days).
optional paymentEnabled: boolean;
Defined in: applications/lib/types/CapabilityVoice.ts:85
Indicates whether payment is enabled.
optional payments: object;
Defined in: applications/lib/types/CapabilityVoice.ts:116
Payment gateway configuration.
optional gateways: unknown[];
List of payment gateways.
optional region: VoiceRegions | string;
Defined in: applications/lib/types/CapabilityVoice.ts:111
Region to round calls
Selecting a region means all inbound, programmable SIP and SIP connect calls will be sent to the selected region unless the call is sent to a regional endpoint. If the call is using a regional endpoint, this will override the application setting.
optional signedCallbacks: boolean;
Defined in: applications/lib/types/CapabilityVoice.ts:92
Whether to use signed webhooks for voice events.
Refer to https://developer.vonage.com/en/getting-started/concepts/webhooks#decoding-signed-webhooks for more information.
optional webhooks: object;
Defined in: applications/lib/types/CapabilityVoice.ts:65
Webhook configuration for voice events.
optional answerUrl: AnswerCallbackUrl;
Webhook for voice call answer events.
optional eventUrl: EventCallbackUrl;
Webhook for events related to voice calls.
optional fallbackAnswerUrl: FallbackAnswerUrl;
Webhook for fallback voice call answer events.
type CapabilityVoiceResponse = object & Omit<CapabilityVoice, "webhooks" | "paymentEnabled" | "signedCallbacks" | "conversationsTTL">;
Defined in: applications/lib/types/Response/CapabilityVoiceResponse.ts:71
Represents the response for voice-related capabilities configuration.
conversations_ttl: number;
The length of time named conversations will remain active for after creation, in hours. 0 means infinite. Maximum value is 744 (i.e., 31 days).
payment_enabled: boolean;
Indicates whether payment is enabled.
signed_callbacks: boolean;
Whether to use signed webhooks for voice events. Refer to the Webhooks documentation for more information.
webhooks: object;
Webhook configuration for voice events.
webhooks.answer_url: AnswerUrlResponse;
Webhook for voice call answer events.
webhooks.event_url: EventUrlResponse;
Webhook for events related to voice calls.
webhooks.fallback_answer_url: FallbackAnswerUrlResponse;
Webhook for fallback voice call answer events.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type CapabilityWebhook = object;
Defined in: applications/lib/types/CapabilityWebhook.ts:4
Represents the base properties for a capability webhook configuration.
address: string;
Defined in: applications/lib/types/CapabilityWebhook.ts:8
The URL endpoint to which the webhook data will be sent.
httpMethod: "POST" | "GET";
Defined in: applications/lib/types/CapabilityWebhook.ts:14
The HTTP method to be used when sending data to the webhook endpoint. It can be either 'POST' or 'GET'.
type CapabilityWebhookResponse = object & Omit<CapabilityWebhook, "httpMethod">;
Defined in: applications/lib/types/Response/CapabilityWebhookResponse.ts:12
Represents the response for a capability webhook configuration.
http_method: "POST" | "GET";
The HTTP method to be used when sending data to the webhook endpoint. It can be either 'POST' or 'GET'.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type EventCallbackUrl = object & CapabilityWebhook;
Defined in: applications/lib/types/CapabilityVoice.ts:26
Vonage numbers that are linked to Vonage applications will use the answer_url to retrieve an NCCO, and the event url to send call status information to you
optional connectTimeout: number;
Connection timeout in milliseconds.
optional socketTimeout: number;
Socket timeout in milliseconds.
https://developer.vonage.com/en/getting-started/concepts/webhooks?lang=voice
type EventUrlResponse = object & CapabilityWebhookResponse;
Defined in: applications/lib/types/Response/CapabilityVoiceResponse.ts:13
Event URL configuration response
optional connectTimeout: number;
Connection timeout in milliseconds.
optional socketTimeout: number;
Socket timeout in milliseconds.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type FallbackAnswerUrl = object & CapabilityWebhook;
Defined in: applications/lib/types/CapabilityVoice.ts:44
The fallback answer url can optionally be configured. This is used when answer url is offline or returning an HTTP error code.
optional connectTimeout: number;
Connection timeout in milliseconds.
optional socketTimeout: number;
Socket timeout in milliseconds.
https://developer.vonage.com/en/getting-started/concepts/webhooks?lang=voice
type FallbackAnswerUrlResponse = object & CapabilityWebhookResponse;
Defined in: applications/lib/types/Response/CapabilityVoiceResponse.ts:53
Fallback URL configuration response
optional connect_timeout: number;
Connection timeout in milliseconds.
optional socket_timeout: number;
Socket timeout in milliseconds.
Vonage API's will return information using snake_case
. This represents the
pure response before the client will transform the keys into camelCase
type ListApplicationParams = object;
Defined in: applications/lib/types/ListApplicationParams.ts:4
Parameters for listing applications with pagination.
optional page: number;
Defined in: applications/lib/types/ListApplicationParams.ts:19
The specific page number for pagination.
optional page_size: number;
Defined in: applications/lib/types/ListApplicationParams.ts:14
please use pageSize instead The deprecated size of the page for pagination.
optional pageSize: number;
Defined in: applications/lib/types/ListApplicationParams.ts:8
The size of the page for pagination.
type MergedApplication = Application & ApplicationResponse;
Defined in: applications/lib/applications.ts:44
Represents the application with both the snake_case
and the camelCase
keys.
This is used for backward compatibility with an earlier release of the SDK
which was not transforming the application correctly.
Using snake_case
is considered deprecated
Create a standalone Application client
import { Applications } from '@vonage/application';
const applicationClient = new Applications({
apiKey: VONAGE_API_KEY,
apiSecret: VONAGE_API_SECRET
});
Create an Application client from the Vonage client
import { Vonage } from '@vonage/server-client';
const vonage = new Vonage({
apiKey: VONAGE_API_KEY,
apiSecret: VONAGE_API_SECRET
});
const applicationClient = vonage.application