Comments: @Mentions using the API

Answered
New post

Comments

1 comment

  • Murtza

     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

     

    0
    Comment actions Permalink

Please sign in to leave a comment.