Mentioning users via the REST API
A key need in a team messaging environment is capturing the attention of a person or group within it. When a person is mentioned in a conversation for example, their unread messages in that conversation is highlighted to indicate that a specific message was directed at them. For example:
When a bot needs to mention a user, they use a special markdown syntax to do so:

A bot can also mention an entire team using this markdown syntax:

Within the context of sending a message in Javascript, it might look like this:
const RC = require('@ringcentral/sdk').SDK
require('dotenv').config();
var rcsdk = new RC({
'server': process.env.RC_SERVER_URL,
'clientId': process.env.RC_APP_CLIENT_ID,
'clientSecret': process.env.RC_APP_CLIENT_SECRET
});
var platform = rcsdk.platform();
platform.login({ 'jwt': process.env.RC_USER_JWT })
platform.on(platform.events.loginSuccess, () => {
post_mention()
})
async function post_mention(){
try {
let personId = "1234";
let groupId = "5678";
let endpoint = `/team-messaging/v1/chats/${groupId}/posts`
let bodyParams = {
text: `Here is a mention: `
}
let resp = await platform.post(endpoint, bodyParams)
let jsonObj = await resp.json()
console.log(jsonObj)
} catch(e) {
console.log(e.message)
}
}