Contents
On this page

List Questions - Plugixa Exam

GET /plugixa-exam/v1/questions

List the questions in the question bank, one page at a time, with filters for subject, type, difficulty and status.

Scope questions:read; the token’s user needs the questions:view permission.

Request

GET https://your-site.example/wp-json/plugixa-exam/v1/questions?subject_id=4&published=1&per_page=20

Query parameters

Name Type Default Description
subject_id integer Questions in this subject and in every subject below it.
question_type string Exact type key, for example mcq_single. See List Question Types.
difficulty integer Exact difficulty, 1 to 5. 0 means no filter.
published string any any, 1 for published only, 0 for unpublished only.
include string Comma-separated question ids: only those questions are returned. The first 200 ids are used.
custom_fields[<name>] string, number or {min, max} PRO Filters on a custom field, with the Custom fields app on. Only searchable fields count: unknown or non-searchable names are silently ignored. At most 5 such filters per request.

Plus the list parameters every paged list accepts. search looks in title and stem. orderby accepts id, title, question_type, difficulty, default_points, created_at and modified_at.

Responses

200 OK. data is one page of questions.

List rows leave out stem, explanation and options, and add option_count. Use Get Question for the full question.

{
  "success": true,
  "data": [
    {
      "id": 12,
      "subject_id": 4,
      "question_type": "mcq_single",
      "title": "Capital of France",
      "slug": "capital-of-france",
      "difficulty": 2,
      "default_points": 1,
      "answer_key": { "negative_marking": false, "min_score": 0 },
      "shuffle_options": true,
      "published": true,
      "version": 3,
      "approval_status": "approved",
      "rubric": null,
      "custom_fields": null,
      "render_hint": null,
      "created_at": "2026-11-10 14:05:00",
      "modified_at": "2026-11-12 09:30:00",
      "created_by": 1,
      "modified_by": 1,
      "deleted_at": null,
      "option_count": 4,
      "tag_ids": [5, 8]
    }
  ],
  "meta": { "total": 37, "pages": 2 }
}
Field Type Meaning
data[].id integer The question’s id
data[].subject_id integer Its subject, 0 when it has none
data[].question_type string Type key
data[].difficulty integer 1 to 5
data[].default_points number Points the question is worth by default
data[].answer_key object|null Marking rules; the shape depends on the type (see Create Question)
data[].published boolean Whether the question is published
data[].version integer Starts at 1 and goes up by one on every update
data[].approval_status string draft or approved
data[].custom_fields object|null The stored custom field values, as saved
data[].option_count integer How many options the question has
data[].tag_ids integer[] Tag ids. Only present when the Tags app is on
data[].deleted_at string|null null unless the question is in the trash
meta.total integer Questions matching the filters, before paging
meta.pages integer Number of pages at this per_page

Errors

Status Code When
400 rest_invalid_param published is not any, 1 or 0.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-exam/v1/questions?subject_id=4&published=1&per_page=20" \
  -H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$query = http_build_query(['subject_id' => 4, 'published' => '1', 'per_page' => 20]);
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/questions?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('PLUGIXA_EXAM_TOKEN'),
    ],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const query = new URLSearchParams({ subject_id: '4', published: '1', per_page: '20' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-exam/v1/questions?${query}`, {
  headers: {
    'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
  },
});
const { data, meta } = await response.json();

Quick Links

Share