Latest Glip Bot Provisioning Flow

Tyler Liu
RingCentral Developers
4 min readFeb 1, 2018

In this article, we will talk about latest best practice to create Glip bots.

First things first: what is Glip?

https://glip.com/ Better collaboration and productivity with team messaging, file sharing, and more.

I always tell people, when they ask me how I run my business and stay so efficient, that it all starts with Glip. It’s my best tool — it’s my ninja weapon.

- Sara Moore, CEO of SEA Media

All our teams have very specialized tasks, but they all have to work together. Glip is probably the number-one way they communicate.

- Daniel Jagd, VP of Strategic Relations at Travelers Haven

It’s Glip tasks and conversations for us all day, especially because the work is so deadline driven. It’s really, really tough to get stuff in on time. We wouldn’t be able to do it if we didn’t have a central place where we can see everything on a calendar.

- Sam Lawrence, Editor-in-chief of Bullet Music

Why do we need Glip bots?

Chatbots, or bots for short, are a great way to extend the capabilities of RingCentral’s Glip team messaging solution by adding applications that interact with users via text chat. Bots have become extremely popular as people spend more time on chat and prefer to interact with multiple services through a single chat app than multiple separate apps such as website or mobile apps.

How to create a new Glip bot?

You can find several articles/tutorials by doing a simple Google search. But most of them are out-of-date. Here I am going to tell you the latest process.

First of all, you need a RingCentral Developer account. If you don’t already have one please create one here: https://developer.ringcentral.com/free-tier-sign-up.html

Login RingCentral developer site:

Create a new app:

Get a token for bot.

We just created a new app with type “Server/Bot”. It’s a special app type, and with this app type, you can get a token which expires in 20 years. 20 years is such a long time that we can deem it as never expire. So as long as we get a new token, we can use it forever.

You can create a website, just to generate the token. Because, you need a public redirect uri. If you think it’s too much work (I do), you can use a tool created by me: https://github.com/tylerlong/ringcentral-token-generator

You can download this tool here: https://github.com/tylerlong/ringcentral-token-generator/releases

You can find the Client ID and Client Secret from your app’s dashboard page:

Click “Next” button, and in the next screen you can find a redirectUri:

Copy the redirectUri, and configure it to your app:

Switch to the “Bot” tab of the app, Click the “Add to Glip” button:

Name your bot “my-awesome-bot”:

Click the “Authorize” button, and in the “RingCentral Token Generator” tool, you can find the token generated:

Copy and save the token generated, we will use it later.

Create a new Node.js project, with the following content:

Please pay attention, in order to run the code above, you need to create a .env file with the following content: token=<token>. And <token> is what we got from last step.

Full source code is available here: https://github.com/tylerlong/my-awesome-bot/tree/official-sdk

Start this Node.js script, and let’s test.

Login Glip sandbox environment: https://glip.devtest.ringcentral.com/

Find an the bot user named “my-awesome-bot”. If you cannot find it, try logout then login again.

Send “ping” to the bot, if everything goes well, it will reply you with “pong”:

Congratulations! You have successfully tested your first Glip bot!

The bot is pretty simple, it just replies “pong” upon receiving “ping”. Our code is deadly simple too, you can write your own code to make the bot truly awesome!

OK, it’s time to end this tutorial! Please leave comments if you have questions!

--

--