Mention in Comments

Create a mention in comment/reply

You can mention users in comments and replies. Just type the @ symbol before the userId. To mention users in comments, the same method is used in creating a comment but with the addition of the mentionees parameter.

You need to specify the following parameters:

  • referenceType - possible values are 'content' and 'post'. Refer to Comment reference type for a more detailed explanation of the referenceType parameter.

  • referenceId - ID of the post/content that you want to add the comment

  • data - comment body

  • mentionees - array of Amity.Mentionable objects. The type in mention for a comment/reply can be only user.

The method will return a comment model.

A comment should not exceed 20,000 characters in length.

Edit a comment/reply with mention

To update a comment/reply with mentions, use the sample code below. The same method is used in editing a comment but with the addition of the mentionees parameter. The method will return a comment model.

Last updated