List numbers that can be used to dial into a meeting
This code snippet shows how to list all dial numbers using the Meetings API.
See the API Reference for more information.
Example Request
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named request.js and add the following code:
const { Auth } = require('@vonage/auth');
const { Meetings } = require('@vonage/meetings');
const credentials = new Auth({
privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH,
applicationId: VONAGE_APPLICATION_ID,
});
const meetingsClient = new Meetings(credentials);Write the code
Add the following to request.js:
meetingsClient.getDialInNumbers(SESSION_ID)
.then((numbers) => console.log(numbers))
.catch((error) => console.error(error));Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
implementation 'com.vonage:server-sdk:8.15.1'Create a class named ListDialInNumbers and add the following code to the main method:
VonageClient client = VonageClient.builder()
.applicationId(VONAGE_APPLICATION_ID)
.privateKeyPath(VONAGE_PRIVATE_KEY_PATH)
.build();Write the code
Add the following to the main method of the ListDialInNumbers class:
List<DialInNumber> dialInNumbers = client.getMeetingsClient().listDialNumbers();
dialInNumbers.forEach(din -> System.out.println(din.getDisplayName()+": "+din.getNumber()));Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
apply plugin: 'application'
mainClassName = project.hasProperty('main') ? project.getProperty('main') : ''Run the following gradle command to execute your application, replacing com.vonage.quickstart.meetings with the package containing ListDialInNumbers:
Prerequisites
Create a file named GetDialsNumbers.cs and add the following code:
using Vonage;
using Vonage.Request;Add the following to GetDialsNumbers.cs:
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath);
var client = new VonageClient(credentials);Write the code
Add the following to GetDialsNumbers.cs:
var response = await client.MeetingsClient.GetDialNumbersAsync();Prerequisites
Create a file named request.py and add the following code:
import vonage
client = vonage.Client(
application_id=VONAGE_APPLICATION_ID,
private_key=VONAGE_APPLICATION_PRIVATE_KEY_PATH,
)Write the code
Add the following to request.py:
response = client.meetings.list_dial_in_numbers()Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named list-dial-in-numbers.rb and add the following code:
Run your code
Save this file to your machine and run it:
Example Response
[
{
"number": 17323338801,
"locale": "en-US",
"display_name": "United States"
}
]