countComments( )


Counts comments, given the specified filtering. Comments with the HIDDEN status are not included in the response.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Comments
Learn more about app permissions.
Method Declaration
Copy
function countComments(
  appId: string,
  options: CountCommentsOptions,
): Promise<CountCommentsResponse>;
Method Parameters
appIdstringRequired

App ID to count the comments of.


optionsCountCommentsOptions
Returns
Return Type:Promise<CountCommentsResponse>
JavaScript
import { comments } from "wix-comments.v2"; async function countComments(appId, options) { try { const result = await comments.countComments(appId, options); return result; } catch (error) { console.error(error); // Handle the error } }
Errors
428Failed Precondition

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?