RingCentral Video REST API Quick Start

Last updated: 2024-08-15Contributors
Edit this page

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.

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

  1. Login or create an account if you have not done so already.
  2. Go to Console/Apps and click 'Create App' button.
  3. Select "REST API App" under "What type of app are you creating?" Click "Next."
  4. Under "Authentication" select "JWT auth flow."
  5. 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:

  1. Download our env-template and save it as a file named .env.
  2. 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_APP_CLIENT_ID - set to the Client ID of the app you created above
    • RC_APP_CLIENT_SECRET - set to the Client Secret of the app you created above
    • RC_USER_JWT - set to the JWT credential you created for yourself

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
const path = require('path')
// Remember to modify the path to where you saved your .env file!
require('dotenv').config({ path: path.resolve(__dirname, '../.env') })

// Instantiate the SDK and get the platform instance
var rcsdk = new RC({
    'server':       process.env.RC_SERVER_URL,
    'clientId':     process.env.RC_APP_CLIENT_ID,
    'clientSecret': process.env.RC_APP_CLIENT_SECRET
});
var platform = rcsdk.platform();

/* Authenticate a user using a personal JWT token */
platform.login({ 'jwt':  process.env.RC_USER_JWT })

platform.on(platform.events.loginSuccess, function(e){
    create_meeting()
});

platform.on(platform.events.loginError, function(e){
    console.log("Unable to authenticate this user. Check credentials.", e.message)
    process.exit(1)
});

/*
* Create an instant RCV meeting
*/
async function create_meeting() {
  try {
    endpoint = "/rcvideo/v2/account/~/extension/~/bridges"
    bodyParams = {
      name: "Test Meeting",
      type: "Instant"
    }
    var resp = await platform.post(endpoint, bodyParams)
    var jsonObj = await resp.json()
    console.log("Start Your Meeting: " + jsonObj.discovery.web)
  } catch (e) {
    console.log(`Unable to create an instant RCV meeting. ${e.message}`)
  }
}

Run Your Code

You are almost done. Now run your script.

$ node meetings.js
$ 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.

import os, sys
from dotenv import load_dotenv
from ringcentral import SDK

load_dotenv()

# Create an instant RCV meeting
def create_meeting():
  try:
    bodyParams = {
         'name' : "Test meeting",
         'type' : "Instant"
    }
    endpoint = "/rcvideo/v2/account/~/extension/~/bridges"
    resp = platform.post(endpoint, bodyParams)
    jsonObj = resp.json()
    print ("Start Your Meeting: " + jsonObj.discovery.web)
  except Exception as e:
    print (e)

# Instantiate the SDK and get the platform instance
rcsdk = SDK( os.environ.get('RC_APP_CLIENT_ID'),
             os.environ.get('RC_APP_CLIENT_SECRET'),
             os.environ.get('RC_SERVER_URL') )
platform = rcsdk.platform()


# Authenticate a user using a personal JWT token
def login():
    try:
      platform.login( jwt=os.environ.get('RC_USER_JWT') )
      create_meeting()
    except Exception as e:
      sys.exit("Unable to authenticate this user. Check credentials." + str(e))

login()

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
// Remember to modify the path ./../ pointing to the location where the RingCentral SDK was installed and the .env file was saved!
require('./../vendor/autoload.php');
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->load();

# Instantiate the SDK and get the platform instance
$rcsdk = new RingCentral\SDK\SDK( $_ENV['RC_APP_CLIENT_ID'],
                                  $_ENV['RC_APP_CLIENT_SECRET'],
                                  $_ENV['RC_SERVER_URL'] );
$platform = $rcsdk->platform();

// Authenticate a user using a personal JWT token
try {
  $platform->login( [ "jwt" => $_ENV['RC_USER_JWT'] ] );
  create_meeting();
} catch (\RingCentral\SDK\Http\ApiException $e) {
  exit("Unable to authenticate to platform. Check credentials. " . $e->message . PHP_EOL);
}

/*
* Create an instant RCV meeting
*/
function create_meeting(){
  global $platform;
  $endpoint = "/rcvideo/v2/account/~/extension/~/bridges";
  $bodyParams = array(
      'name' => "Test Meeting",
      'type' => "Instant"
  );
  try {
    $resp = $platform->post($endpoint, $bodyParams);
    print_r ('Start Your Meeting: ' . $resp->json()->discovery->web . PHP_EOL);
  } catch (Exception $e) {
    print_r ("Unable to create an instant RCV meeting. " . $e->getMessage() . PHP_EOL);
  }
}

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.

require 'ringcentral'
require 'dotenv'
# Remember to modify the path to where you saved your .env file!
Dotenv.load("./../.env")

# Create an instant RCV MyMeeting
def create_meeting()
  begin
    bodyParams = {
          name: "Test meeting",
          type: "Instant"
      }
    endpoint =  "/rcvideo/v2/account/~/extension/~/bridges"
    resp = $platform.post(endpoint, payload: bodyParams)
    puts "Start your meeting: " + resp.body['discovery']['web']
  rescue StandardError => e
    puts (e)
  end
end

# Instantiate the SDK and get the platform instance
$platform = RingCentral.new( ENV['RC_APP_CLIENT_ID'], ENV['RC_APP_CLIENT_SECRET'], ENV['RC_SERVER_URL'] )

# Authenticate a user using a personal JWT token
def login()
  begin
    $platform.authorize(jwt: ENV['RC_USER_JWT'])
    create_meeting()
  rescue StandardError => e
    puts ("Unable to authenticate this user. Check credentials." + e.to_s)
  end
end

login()

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_APP_CLIENT_ID"),
                                    Environment.GetEnvironmentVariable("RC_APP_CLIENT_SECRET"),
                                    Environment.GetEnvironmentVariable("RC_SERVER_URL"));

        // Authenticate a user using a personal JWT token
        await restClient.Authorize(Environment.GetEnvironmentVariable("RC_USER_JWT"));
        await create_meeting();
      }
      catch (Exceptione e)
      {
        Console.WriteLine(e.Message);
      }
    }
    /*
    Create a an instant RCV meeting
    */
    private static async Task create_meeting()
    {
      try
      {
        var bodyParams = new CreateBridgeRequest { name = "Test meeting", type = "Instant" };
        var response = await restClient.Rcvideo().V2().Account("~").Extension("~").Bridges().Post(bodyParams);
        Console.WriteLine("Start Your Meeting:  " + response.discovery.web);
      }
      catch (Exception 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_APP_CLIENT_ID
    • RC_APP_CLIENT_SECRET
    • RC_SERVER_URL
    • RC_USER_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) {
    var obj = new CreateMeeting();
    try {
      // Instantiate the SDK
      restClient = new RestClient(System.getenv("RC_APP_CLIENT_ID"), System.getenv("RC_APP_CLIENT_SECRET"), System.getenv("RC_SERVER_URL"));

      // Authenticate a user using a personal JWT token
      restClient.authorize(System.getenv("RC_USER_JWT"));

      obj.create_meeting();
    } catch (RestException | IOException e) {
      e.printStackTrace();
    }
  }

  /*
  * Create an instant RCV meeting
  */
  public void create_meeting() throws RestException, IOException{
    var bodyParams = new CreateBridgeRequest();
    bodyParams.name = "Test Meeting";
    bodyParams.type = "Instant";
    var response = restClient.rcvideo().v2().account("~").extension("~").bridges().post(bodyParams);
    System.out.println("Start Your Meeting: " + response.discovery.web);
  }
}

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!

Search the forums »

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.

Take your next step »