Meetings API

API Spotlight: Meetings API

Mike Stowe
RingCentral Developers
4 min readOct 15, 2019

--

We all wish we had the ability to meet instantly — well except for old Mr. McFly (who probably wished he wasn’t in the future). With RingCentral’s Meetings API, you can not only just do that (plus with our Fax APIs you can make sure they get it on paper too), but you can control when to schedule, update, and end a meeting (something McFly probably wishes HE could have done).

Plus — did we mention meetings is already included in your office subscription? How totally rad (or whatever they say in the future) is that?

Step 1: Create our App
To get started, we’ll create our app. Since this will be an app just for our internal usage (ie not shared with all of RingCentral’s customers) we’ll select “Private” for Application Type. And be sure to select “Server-only (No UI)” for platform type to have access to both access flows.

Once you’ve selected the appropriate application type and platform form, click “next.” Now select “Meetings” for the required permissions and click “Create.”

Step 2: Install the SDK
With our application setup, it’s now time to install the PHP SDK (or whichever language you prefer). You can use your own API library, or build it out yourself using cURL, but this will make using the Meetings API (and all of our other APIs) a lot easier.

To install the PHP SDK, first download it from GitHub. You’ll then need to install the vendor dependencies using Composer (see instructions here).

To include the SDK in our script, simply include the vendor Autoloader:

// Include Libraries
require('vendor/autoload.php');

And then instantiate the class using your SandBox client_id and client_secret:

// Setup Client
$sdk = new RingCentral\SDK\SDK(CLIENT_ID, CLIENT_SECRET, RingCentral\SDK\SDK::SERVER_SANDBOX);

Finally, utilize the platform()->login() method to access your RingCentral Sandbox account. To reduce the number of auth calls, you can use platform()->loggedIn() to return a boolean of whether or not you have an active session already:

// Login via API
if (!$sdk->platform()->loggedIn()) {
$sdk->platform()->login(username, extension, password);
}

Note: If you receive an authorized grant type error — be sure you setup your application correctly, using the Server-Only (No UI) platform type. Otherwise you will not have access to the Password Flow.

Step 3: Create a Meeting
Just like that you’ve hooked into the RingCentral API. I know, it’s not quite the wild wild west, but how many sequels do you really need?

The next step is to create a new meeting with the /meeting resource. We’ll get started by placing the necessary information into an array:

// Data to Create a New Meeting
$data = array(
'topic' => 'Discuss Best Movie Ever',
'meetingType' => 'Scheduled',
'password' => 'Oct 21 2015',
'schedule' => array(
'startTime' => '2045-10-21T04:07:52.534Z',
'durationInMinutes' => '60'
),
'allowJoinBeforeHost' => false,
'startHostVideo' => true,
'startParticipantVideo' => true,
'audioOptions' => 'Phone,ComputerAudio'
);

Now, POST your data to the /meeting resource:

// Create Meeting
$sdk->platform()->post('/account/~/extension/~/meeting', $data);

But Wait — That’s the Wrong Type of Hoverboard!!!!
I know — I was disappointed too. Not only were they prone to starting fires… but they also didn’t do quite as well on water.

Unfortunately, the same thing can happen with meetings at work. Things happen, the unexpected occurs, you buy a sports book and accidentally give it to your arch nemesis. Thankfully, making updates via the RingCentral API is just as easy as creating a meeting.

To make updates, first get your meeting information using the /meeting/{meeting_ID} resource:

// Get Meeting Data
$data = json_decode($sdk->platform()->get('/account/~/extension/~/meeting/{meeting_ID}'));

Now make your changes the the data object:

// Updated Meeting Information
$data->schedule->startTime = '2032-06-13T04:07:52.534Z';

And finally send back to the /meeting/{meeting_ID} resource using a PUT:

// Update Meeting
$sdk->platform()->put('/account/~/extension/~/meeting/{meeting_ID}', $data);

Is this the End?!
Not quite. But hang in there — you’re almost at 88mph. Thankfully ending a meeting is far easier than ending this post. To end your meeting, just call the /meeting/{meeting_ID}/end resource using the POST method:

// End a Started Meeting
$sdk->platform()->post('/account/~/extension/~/meeting/{meeting_ID}/end');

Pretty easy huh? And no plutonium, recycled garbage, or clock towers are required!

Can’t We Just Go Back to the Future?
Yes… no… I don’t know. I actually confused myself on this one. BUT we can delete the meeting altogether (especially in the case of a Hoverboard or Sports Book gone wrong).

To do this, just make a call to the /meeting/{meeting_ID} resource using the DELETE method:

// Delete Meeting
$sdk->platform()->delete('/account/~/extension/~/meeting/{meeting_ID}');

I’m Impressed
If you’ve made this far, I have to say I’m quite impressed, especially for putting up with all of my Back to the Future references (perhaps the greatest movie of all time)? Especially since time-travel is hard — unless you’re Strange (possibly a hint towards my next movie reference). Creating, updating, ending, and deleting meetings shouldn’t be.

But if you run into questions, feel free to take advantage of our Developer Forum, Glip Channel, and Twitter (just be sure to tweet your best movie references/ puns).

Or… if you’re really brave…

--

--

Mike Stowe
RingCentral Developers

Developer, actor, and a *really* bad singer. Fan of APIs, Microservices, and #K8s.