Skip to content
You are reading the pinned copy of v1.0, which is also the latest release. Read the latest.

Questions (admin API)

Admin routes of the questions module. Every route needs a staff session and the permission named on it; send X-Resolve-Locale: false to receive every locale of a translatable field for editing.

List questions (admin)

Parameters:

  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).
  • productId in query (string, optional).
  • search in query (string, optional).
  • sortBy in query ("createdAt", "helpfulCount", "updatedAt", optional).
  • sortOrder in query ("asc", "desc", optional).
  • status in query ("HIDDEN", "PENDING", "PUBLISHED", optional).

Responses:

  • 200: Questions retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Answer product question (admin)

Parameters:

  • id in path (string, required).

Request body: AnswerQuestionAdminDto.

Responses:

  • 200: Answer added.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Question not found.

Approve question

Parameters:

  • id in path (string, required).

Responses:

  • 200: Question approved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Question not found.

Reject question

Parameters:

  • id in path (string, required).

Request body: ModerateReviewDto.

Responses:

  • 200: Question rejected.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Question not found.
  • answer (string, min length 1, max length 5000, required).
  • isAdminAnswer (boolean, optional).
  • reason (string, max length 1000, optional).
As seen on Open Source Alternatives The Merchant Engine badge