RingCentral Video REST API Quick Start
RingCentral Video REST API and Client SDKs are in beta
The RingCentral Video REST API and Client SDKs are currently in beta. Developers should be aware of the following:
- Their feature sets are not reflective of the full scope currently planned.
- Backwards compatibility is not guaranteed from one release to the next during the beta period. Changes can be introduced at any time that may impact your applications with little notice.
- Video APIs are not currently available in our sandbox environment and developers are asked to do development in our production environment.
Calling the RingCentral API for the first time? We recommend you try out getting started experience.
In this quick start, we are going to help you create your first meeting on the platform in just a few minutes. Let's get started.
Create an app
The first thing we need to do is create an app in the RingCentral Developer Portal. This can be done quickly by clicking the "Create Video App" button below. Just click the button, enter a name and description if you choose, and click the "Create" button. If you do not yet have a RingCentral account, you will be prompted to create one.
Create Video App Show detailed instructions
- Login or create an account if you have not done so already.
- Go to Console/Apps and click 'Create App' button.
- Select "REST API App" under "What type of app are you creating?" Click "Next."
- Under "Authentication" select "JWT auth flow."
- Under "Security" select "This app is private and will only be callable using credentials from the same RingCentral account."
When you are done, you will be taken to the app's dashboard. Make note of the Client ID and Client Secret. We will be using those momentarily.
Download and edit a .env
file
Follow the instructions found in our guide to running Developer Guide code samples. Or:
- Download our env-template and save it as a file named
.env
. - Edit your newly downloaded
.env
file, setting its variables with the proper values for the app you created above, paying close attention to the following:RC_CLIENT_ID
- set to the Client ID of the app you created aboveRC_CLIENT_SECRET
- set to the Client Secret of the app you created aboveRC_JWT
- set to the JWT credential you created for yourself
Please use production credentials to call the Video API
RingCentral Video is not currently available in sandbox. To successfully call the API, please do development directly in our production environment.
Create a meeting bridge
Install RingCentral Node.js SDK
$ npm install @ringcentral/sdk
Create and edit meetings.js
Create a file called meetings.js
. Be sure to edit the variables in ALL CAPS with your app and user credentials.
const RC = require('@ringcentral/sdk').SDK
require('dotenv').config();
var rcsdk = new RC({
'server': process.env.RC_SERVER_URL,
'clientId': process.env.RC_CLIENT_ID,
'clientSecret': process.env.RC_CLIENT_SECRET
});
var platform = rcsdk.platform();
platform.login({ 'jwt': process.env.RC_JWT })
platform.on(platform.events.loginSuccess, () => {
create_meeting()
})
async function create_meeting() {
try {
var resp = await platform.post("/rcvideo/v2/account/~/extension/~/bridges", {
name: "Test Meeting",
allowJoinBeforeHost: true,
muteAudio: false,
muteVideo: true
})
var json = await resp.json()
console.log("Start Your Meeting: " + json.discovery.web)
} catch (e) {
console.log(e.message)
}
}
Run Your Code
You are almost done. Now run your script.
$ node meetings.js
Install RingCentral Python SDK (Python version 3.x recommended)
$ pip install ringcentral
Create and edit meetings.py
Create a file called meetings.py
. Be sure to edit the variables in ALL CAPS with your app and user credentials.
#!/usr/bin/python
# You get the environment parameters from your
# application dashbord in your developer account
# https://developers.ringcentral.com
import os
import sys
from dotenv import load_dotenv
from ringcentral import SDK
load_dotenv()
rcsdk = SDK( os.environ.get('RC_CLIENT_ID'),
os.environ.get('RC_CLIENT_SECRET'),
os.environ.get('RC_SERVER_URL') )
platform = rcsdk.platform()
try:
platform.login( jwt=os.environ.get('RC_JWT') )
except Exception as e:
sys.exit("Unable to authenticate to platform: " + str(e))
params = {
'name': 'Test Meeting'
}
try:
resp = platform.post('/rcvideo/v2/account/~/extension/~/bridges', params)
print("Start your meeting: " + resp.web.discovery)
except Exception as err:
print("Exception: " + err.message)
Run Your Code
You are almost done. Now run your script.
$ python meetings.py
Install RingCentral PHP SDK
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar require ringcentral/ringcentral-php
Create and edit meetings.php
Create a file called meetings.php
. Be sure to edit the variables in ALL CAPS with your app and user credentials.
<?php
/* You get the environment parameters from your
application dashbord in your developer account
https://developers.ringcentral.com */
require('vendor/autoload.php');
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->load();
$rcsdk = new RingCentral\SDK\SDK( $_ENV['RC_CLIENT_ID'],
$_ENV['RC_CLIENT_SECRET'],
$_ENV['RC_SERVER_URL'] );
$platform = $rcsdk->platform();
$platform->login( [ "jwt" => $_ENV['RC_JWT'] ] );
$params = array(
'name' => 'Test Meeting'
);
try {
$resp = $platform->post('/rcvideo/v2/account/~/extension/~/bridges', $params);
print_r ('Start Your Meeting: ' . $resp->json()->web->discovery . "\n");
} catch (Exception $e) {
print_r ("An error occurred: " . $e->getMessage() . "\n");
}
Run Your Code
You are almost done. Now run your script.
$ php meetings.php
Install RingCentral Ruby SDK
$ gem install ringcentral-sdk
Create and edit meetings.rb
Create a file called meetings.rb
. Be sure to edit the variables in ALL CAPS with your app and user credentials.
#!usr/bin/ruby
# You get the environment parameters from your
# application dashbord in your developer account
# https://developers.ringcentral.com
require 'ringcentral'
require 'dotenv/load'
$rc = RingCentral.new(ENV['RC_CLIENT_ID'],
ENV['RC_CLIENRT_SECRET'],
ENV['RC_SERVER_URL'])
$rc.authorize(jwt: ENV['RC_JWT'])
resp = rc.post('/rcvideo/v2/account/~/extension/~/bridges', payload: {
'name': 'Test Meeting'
})
puts "Start your meeting: " + resp.body['discovery']['web']
Run Your Code
You are almost done. Now run your script.
$ ruby meetings.rb
Create a Visual Studio project
- Choose Console Application .Net Core -> App
- Select Target Framework .NET Core 2.1 or higher version
- Enter project name "Send_SMS"
- Add NuGet package RingCentral.Net (6.0.0) SDK
- Save the .env file under your project folder. E.g. /Send_SMS/bin/Debug/netcoreapp2.2/.env
Edit the file Program.cs
using System;
using RingCentral;
namespace CreateMeeting
{
class Program
{
static RestClientrest Client;
static async Task Main()
{
try
{
DotEnv.Load();
// Instantiate the SDK
restClient = new RestClient(Environment.GetEnvironmentVariable("RC_CLIENT_ID"), Environment.GetEnvironmentVariable("RC_CLIENT_SECRET"), Environment.GetEnvironmentVariable("RC_SERVER_URL"));
// Authenticate a user using a personal JWT token
await restClient.Authorize(Environment.GetEnvironmentVariable("RC_JWT"));
await createMeeting();
}
catch (Exceptione e)
{
Console.WriteLine(e.Message);
}
}
/*
Create a new meeting with specific parameters
*/
private static async Task createMeeting()
{
try
{
var createBridgeRequest = new CreateBridgeRequest { name = "MyMeeting", type = "Scheduled", };
BridgeResponse bridgeResponse = await restClient.Rcvideo().V2().Account("~").Extension("~").Bridges().Post(createBridgeRequest);
Console.WriteLine("Meeting Created Id "bridgeResponse.id" Name "bridgeResponse.name" type " + bridgeResponse.type);
}
catch (Exceptione e)
{
Console.WriteLine(e.Message);
}
}
}
}
Run Your App
You are almost done. Now run your app from Visual Studio.
Create a Java project (using Eclipse IDE)
- Create a new Java project
- Select the Gradle Project wizard
- Enter project name "SendSMS"
-
Open the build.gradle file and add the RingCentral Java SDK to the project as shown below:
dependencies { // ... compile 'com.ringcentral:ringcentral:3.0.0' }
-
On Eclipse menu, select "Run" and choose the "Run Configurations" and in the dialog, select your project and select the "Environments" tab then enter the following variables:
- RC_CLIENT_ID
- RC_CLIENT_SECRET
- RC_SERVER_URL
- RC_JWT
-
Right-click the project in the Package Explorer and choose "Refresh Gradle Project" under the "Gradle" sub-menu
Create a new Java Class
Select "File -> New -> Class" to create a new Java class named "CreateMeeting"
package CreateMeeting;
public class CreateMeeting {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
Edit the file "CreateMeeting.java".
package CreateMeeting;
import com.ringcentral.*;
import java.io.IOException;
public class CreateMeeting {
static RestClient restClient;
public static void main(String[] args) {
try {
// Instantiate the SDK
restClient = new RestClient(System.getenv("RC_CLIENT_ID"),
System.getenv("RC_CLIENT_SECRET"),
System.getenv("RC_SERVER_URL"));
// Authenticate a user using a personal JWT token
restClient.authorize(System.getenv("RC_JWT"));
} catch (RestException restException) {
System.out.println(restException.getMessage());
} catch (IOException ioException) {
ioException.printStackTrace();
}
}
public void createMeeting() throws IOException, RestException {
CreateMeetingRequest createMeetingRequest = new CreateMeetingRequest()
.name("Test Meeting")
.allowJoinBeforeHost(true)
.muteAudio(false)
.muteVideo(true);
CreateMeetingResponse createMeetingResponse =
restClient.post("/rcvideo/v2/account//extension//bridges",createMeetingRequest);
String meetingUrl = createMeetingResponse.getDiscovery().getWeb();
System.out.println("Start Your Meeting: " + meetingUrl);
}
}
Run Your App
You are almost done. Now run your app from Eclipse.
Need help?
Having difficulty? Feeling frustrated? Receiving an error you don't understand? Our community is here to help and may already have found an answer. Search our community forums, and if you don't find an answer please ask!
What's next?
When you have successfully made your first API call, it is time to take your next step towards building a more robust RingCentral application. Have a look at our private sample (please provide us your GitHub username to allow access to this repo) Node.JS application for reference purpose.