This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation.
When you install Wix Comments on a site, the system creates a default category. When a site visitor creates a comment, the system automatically assigns the comment to the default category.
To redirect a new comment to a custom category:
Create a new category using Create Category, or identify an existing category to use. Save the categoryId.
Listen for the Comment Created event. When the event triggers, you'll receive the newly created comment in the payload. Extract the id and revision of the comment.
Call Update Comment with:
id: The ID of the comment that was just created.revision: Revision number of the comment that was just created.contextId: The categoryId of the destination category.Deleting a category with comments orphans those comments, preventing them from loading and causing errors. Before deleting a category, you must either delete all the comments it contains or move them to another category:
To delete all the comments from a category and then delete the category itself:
Call Bulk Delete Comment with a filter for all comments where contextId matches the category ID you intend to delete.
Call Delete Category to delete the now-empty category.
To move all the comments out of a category and then delete the category itself:
Create a new category using Create Category or identify an existing category to use.
Call Bulk Move Comment By Filter with a filter where contextId matches the category ID you intend to delete. Set the destination to the new category.
Call Delete Category to delete the now-empty category.
You can retrieve recent comments written across all blog posts or product pages. Use this to display recent activity to site visitors.
Call Query Category to retrieve a list of categories available for a site and find the categoryId for the category you want to highlight.
Call List Comments By Resource with the categoryId retrieved above as the contextId and commentSort.order set to "NEWEST_FIRST".