RingOut C# Quick Start

Last updated: 2020-02-29 Contributors Byrne ReesePaco Vu

Welcome to the RingCentral Platform. RingCentral is the leading unified communications platform. From one system developers can integrate with, or build products around all the ways people communicate today: SMS, voice, fax, chat and meetings.

In this Quick Start, we are going to help you connect two people in a live phone call using our RingOut API, which dials two phone numbers, and then connects the two people when they answer. 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 RingOut 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 RingOut 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 "Office Integration App" under "What type of app are you creating?"
  4. Select "Other Non-UI" under "Where will you be calling the API from?"
  5. Select "Only members of my organization/company" under "Who will be authorized to access your app?"
  6. On the second page of the create app wizard, enter your app's name and description. Then select the following permissions:
    • RingOut
  7. We are using Password Flow authentication, so leave "OAuth Redirect URI" blank.

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.

Place a Call

Create a Visual Studio project

  • Choose Console Application .Net Core -> App
  • Select Target Framework .NET Core 2.1
  • Enter project name "Call_Ringout"
  • Add NuGet package RingCentral.Net (1.2.1) SDK

Edit the file Program.cs

Be sure to edit the variables in ALL CAPS with your app and user credentials. Be sure to also set the recipient's phone number.

using System;
using System.Threading.Tasks;
using RingCentral;

namespace Call_Ringout
{
    class Program
    {
          const string RECIPIENT = "<ENTER PHONE NUMBER>";

          const string RINGCENTRAL_CLIENTID = "<ENTER CLIENT ID>";
          const string RINGCENTRAL_CLIENTSECRET = "<ENTER CLIENT SECRET>";

          const string RINGCENTRAL_USERNAME = "<YOUR ACCOUNT PHONE NUMBER>";
          const string RINGCENTRAL_PASSWORD = "<YOUR ACCOUNT PASSWORD>";
          const string RINGCENTRAL_EXTENSION = "<YOUR EXTENSION, PROBABLY '101'>";

          static RestClient restClient;

          static void Main(string[] args)
          {
              restClient = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, RINGCENTRAL_PRODUCTION);
              restClient.Authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD).Wait();
              call_ringout().Wait();
          }
          static private async Task call_ringout()
          {
              var parameters = new MakeRingOutRequest();
              parameters.from = new MakeRingOutCallerInfoRequestFrom { phoneNumber = RINGCENTRAL_USERNAME };
              parameters.to = new MakeRingOutCallerInfoRequestTo {  phoneNumber = RECIPIENT } ;
              parameters.playPrompt = false;

              var resp = await restClient.Restapi().Account().Extension().RingOut().Post(parameters);
              Console.WriteLine("Call Placed. Call status" + resp.status.callStatus);
          }
      }
}

Run Your App

You are almost done. Now run your app from Visual Studio.

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.

Take your next step »