Create Team Messaging Team Quick Start

Last updated: 2022-02-04 Contributors Suyash JoshiByrne ReeseNonePaco VuYoann Lecuyer
Edit this page

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 create a new RingCentral team in just a few minutes. Let's get started.

Create App and Get Credentials

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 Team 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 Team 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 "Password-based auth flow."
  5. Under "Security" add the following permissions:
    • Team Messaging
  6. 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.

Create a Team

Select your preferred language below.

Install RingCentral JavaScript SDK

$ npm install @ringcentral/sdk dotenv --save

Create and edit create-team.js

Create a file called create-team.js using the contents below.

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({
    'username':  process.env.RC_USERNAME,
    'password':  process.env.RC_PASSWORD,
    'extension': process.env.RC_EXTENSION
})

platform.on(platform.events.loginSuccess, () => {
  create_team()
})

async function create_team() {
  var endpoint = "/restapi/v1.0/glip/teams"
  var params = {
    public: true,
    name: "Fun team",
    members: [{ email: "member.1@gmail.com" }, { email: "member.2@gmail.com" }],
    description: "Let's chit chat here"
  }
  try {
    var resp = await platform.post(endpoint, params)
    var jsonObj = await resp.json()
    console.log(JSON.stringify(jsonObj))
  } catch (e) {
    console.log(e)
  }
}

Run your code

You are almost done. Now run your script. Then login to your account at https://app.devtest.ringcentral.com/ to see the newly created team.

$ node create-team.js

Install RingCentral Python SDK

$ pip install ringcentral python-dotenv

Create and Edit create-team.py

Create a file called create-team.py using the contents below.

#!/usr/bin/env python
from ringcentral import SDK
import os,sys

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(os.environ.get('RC_USERNAME'),
                 os.environ.get('RC_EXTENSION'),
                 os.environ.get('RC_PASSWORD') )
except:
  sys.exit("Unable to authenticate to platform. Check credentials.")

endpoint = "/restapi/v1.0/glip/teams"
params = {
    "public": True,
    "name": "Fun team",
    "members": [{ "email": "member.1@gmail.com"}, {"email":"member.2@gmail.com"}],
    "description": "Let's chit chat here"
}
resp = platform.post(endpoint, params)
print(resp.text())

Run your code

You are almost done. Now run your script. Then login to your account at https://app.devtest.ringcentral.com/ to see the newly created team.

$ python create-team.py

Install RingCentral PHP SDK

$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar require ringcentral/ringcentral-php vlucas/phpdotenv

Create and edit create-team.php

Create a file called create-team.php using the contents below.

<?php
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( $_ENV['RC_USERNAME'],
                  $_ENV['RC_EXTENSION'],
                  $_ENV['RC_PASSWORD'] );

$endpoint = "/restapi/v1.0/glip/teams";
$params = array(
      "public" => true,
      "name" => "Fun team",
      "members" => array(array("email" => "member.1@gmail.com"),
                          array("email" => "member.2@gmail.com")),
      "description" => "Let's chit chat here"
);

$resp = $platform->post($endpoint, $params);
print($resp->text());
?>

Run your code

You are almost done. Now run your script. Then login to your account at https://app.devtest.ringcentral.com/ to see the newly created team.

$ php create-team.php

Create a Visual Studio project

  • Choose Console Application .Net Core -> App
  • Select Target Framework .NET Core 2.1
  • Enter project name "Create_Team"
  • Add NuGet package RingCentral.Net (4.1.0) 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 System.Collections.Generic;
using RingCentral;
using Newtonsoft.Json;

namespace Create_Team
{
    class Program
    {
        static RestClient restClient;
        static void Main(string[] args)
        {
            restClient = new RestClient(
                Environment.GetEnvironmentVariable("RC_CLIENT_ID"),
                Environment.GetEnvironmentVariable("RC_CLIENT_SECRET"),
                Environment.GetEnvironmentVariable("RC_SERVER_URL"));
            restClient.Authorize(
                Environment.GetEnvironmentVariable("RC_USERNAME"),
                Environment.GetEnvironmentVariable("RC_EXTENSION"),
                Environment.GetEnvironmentVariable("RC_PASSWORD")).Wait();
            create_team().Wait();
        }
        static private async Task create_team()
        {
            var parameters = new GlipPostTeamBody();
            parameters.@public = true;
            parameters.name = "Fun team";
            parameters.description = "Let's chit chat here";

            var member1 = new CreateGlipMember();
            member1.email = "member.1@gmail.com";
            var member2 = new CreateGlipMember();
            member2.email = "member.2@gmail.com";
            parameters.members = new CreateGlipMember[] { member1, member2 };

            var response = await restClient.Restapi().Glip().Teams().Post(parameters);
            var jsonStr = JsonConvert.SerializeObject(response);
            Console.WriteLine(jsonStr);
        }
    }
}

Run your code

You are almost done. Now run your app from Visual Studio. Then login to your account at https://app.devtest.ringcentral.com/ to see the newly created team.

Create a Java project (using Eclipse IDE)

  • Create a new Java project
  • Select the Gradle Project wizard
  • Enter project name "TeamMessagingQuickStart"
  • Open the build.gradle file and add the RingCentral Java SDK to the project as shown below:
dependencies {
    // ...
    compile 'com.ringcentral:ringcentral:1.4.0'
}
  • 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 "Create_Team"

package TeamMessagingQuickStart;

public class TeamMessagingQuickStart {

  public static void main(String[] args) {
    // TODO Auto-generated method stub

  }
}

Edit the file "TeamMessagingQuickStart.java".

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.

package com.ringcentral;

import java.io.IOException;
import com.ringcentral.*;
import com.ringcentral.definitions.*;

public class TeamMessagingQuickStart {
    static RestClient rc;

    public static void main(String[] args) {
        var obj = new TeamMessagingQuickStart();
    rc = new RestClient( System.getenv("RC_CLIENT_ID"),
                 System.getenv("RC_CLIENT_SECRET"),
                 System.getenv("RC_SERVER_URL") );
    try {
        rc.authorize( System.getenv("RC_USERNAME"),
              System.getenv("RC_EXTENSION"),
              System.getenv("RC_PASSWORD") );
        obj.createTeam();
        } catch (RestException | IOException e) {
        e.printStackTrace();
        }
    }

    public void createTeam() throws RestException, IOException{
        var member1 = new CreateGlipMember();
        member1.email = "member.1@gmail.com";
        var member2 = new CreateGlipMember();
        member2.email = "member.2@gmail.com";

        var parameters         = new GlipPostTeamBody();
        parameters._public     = true;
        parameters.name        = "Fun team";
        parameters.description = "Let's chit chat here";
        parameters.members     = new CreateGlipMember[] { member1, member2 };

        GlipTeamInfo response = rc.restapi().glip().teams().post(parameters);
        System.out.println("Team created: " + response.id);
    }
}

Run your code

You are almost done. Now run your app from Eclipse. Then login to your account at https://app.devtest.ringcentral.com/ to see the newly created team.

Install RingCentral SDK gem

$ gem install ringcentral-sdk dotenv

Create and Edit create-team.rb

Create a file called create-team.rb using the contents below.

require 'ringcentral'
require 'dotenv/load'

$rc = RingCentral.new(ENV['RC_CLIENT_ID'],
                      ENV['RC_CLIENRT_SECRET'],
                      ENV['RC_SERVER_URL'])

$rc.authorize(username: ENV['RC_USERNAME'],
              extension: ENV['RC_EXTENSION'],
              password: ENV['RC_PASSWORD'])

resp = $rc.post('/restapi/v1.0/glip/teams', payload: {
    public: true,
    name: "Fun team",
    members: [{ email: "member.1@gmail.com"}, {email:"member.2@gmail.com"}],
    description: "Let's chit chat here"
})

puts resp.body

Run your code

You are almost done. Now run your script. Then login to your account at https://app.devtest.ringcentral.com/ to see the newly created team.

$ ruby create-team.rb

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 »