Posting simple text messages via the API

Last updated: 2021-05-25 Contributors Byrne Reese
Edit this page

To learn how to post a message to a RingCentral team, let's start with the ubiquitous example: Hello World. To post a message via the API, one must first know the ID of the chat they wish to post to.

To help you find an appropriate team ID to post to regardless of the environment or account you may be running within, we take advantage of a type of chat every RingCentral user has but may not know about: one's "personal" chat.

Finding a safe and private chat ID in which to do development

Every user within RingCentral has a permanent and unique chat that is accessible exclusively by that user. This chat is in fact a chat with a single member: you. This is an ideal chat to post to for development and testing because it is easily discoverable regardless of the environment you may be operating in, and any post traffic you generate their will not intervere with anyone else.

The code sample below queries the Chats endpoint for the chat of type "Personal." The chat id associated with that chat will be found in the response.

var rcsdk = new RC({
var platform = rcsdk.platform();
platform.on(, () => {

async function get_personal_meeting_id() {
    console.log("Getting personal chat")
    var endpoint = "/restapi/v1.0/glip/chats"
    var params = {
    type: 'Personal'
    try {
    var resp = await platform.get( endpoint, params )
    var json = await resp.json()
    var chat_id = json['records'][0]['id']
    console.log("Personal chat ID: " + chat_id)
    } catch (e) {
        console.log("Error: " + e.message);

How to post a simple text message to a chat

With a chat ID in hand, posting is done quickly and easily:

function post_text_message(chat_id) {'/restapi/v1.0/glip/chats/'+chat_id+'/posts', {
    text: "Hello World"
            var json = resp.json()
            var id = json['id']
            console.log("Posted message successfully, id: " + id)

The code above will result in a chat message that appears as follows:

You can also post via an Incoming Webhook

Incoming Webhooks provide an alternative conduit by which messages can be posted to a team. An Incoming Webhook's URL can be input into a third-party service provider to allow them to post event messages into a team on your behalf.

Mini-Markdown: a RingCentral flavor of Markdown

RingCentral supports a simplified version of Markdown to assist in the formatting of text within a message. The following syntaxes are supported for post attachments in addition to post bodies.

Glip/MarkdownResulting Text
[a link]( link
> quote
* bullet
  • bullet

Keep reading...

In this article you learned how to post a simple text message. You can also post the following: