Skip to main content
Question

Comments: @Mentions using the API

  • May 22, 2025
  • 1 reply
  • 12 views

Forum|alt.badge.img

Hi,

According to the developer notes we should be able to add mentions to comments made via the API. The syntax given @[id:username] etc does not seem to work. I did it via the UI and then queried for it, but it just gives the @ where is the user mentioned.

 

What is the API syntax to add a mention to another user so that its is highlighted in the UI.

 

Regards

1 reply

Forum|alt.badge.img

 Thanks for posting this question. I agree the documentation is unclear on how to mention a user and have their name highlighted in the comment UI. 

 

Here's a few things to note to make this work: 

  • When you call the Create Comment endpoint, you specify a value for either the message or tagged_message parameter, but not both.
  • When you are mentioning a user in the comment, you need to use the tagged_message parameter. 
  • The syntax for mentioning a user and have them highlighted in the UI is @[id:username]. For example, the syntax for a user with id=12345 and name=Don is @[12345:Don]. Username is the value of the name attribute on the User object. Please see the Ruby example below.

I'll update the documentation to clarify this.

 

require 'boxr'

client = Boxr::Client.new('DEVELOPER_TOKEN')

#user id is 12345 and the user's name is Don comment = "@[12345:Don] test comment" file = "678" results = client.add_comment_to_file(file, message: nil, tagged_message: comment) puts results