Contents
On this page

Get Exam Prerequisites - Plugixa Exam

GET /plugixa-exam/v1/exams/{id}/prerequisites

List the exams a person must pass, attempt or reach a score on before they can start this one.

Not reachable with an API token: since 1.4.1 a token request to this route answers 403 plugixa_exam_token_route. Call it as a signed-in WordPress user (from a script, with an Application Password) who holds the exams:view permission. Needs Plugixa Exam Pro with the Prerequisites app on in Plugixa Exam -> App Manager; with it off, this route answers 404.

Note. The rows come back exactly as stored: ids, ordering, created_by, modified_by and min_percent are strings, not numbers. An unknown exam id is not an error: it answers 200 with an empty list.

Request

GET https://your-site.example/wp-json/plugixa-exam/v1/exams/7/prerequisites

Path parameters

Name Type Description
id integer The exam’s id

Responses

200 OK. data is the list of prerequisites, in order.

{
  "success": true,
  "data": [
    {
      "id": "3",
      "exam_id": "7",
      "required_exam_id": "5",
      "requirement": "passed",
      "min_percent": null,
      "ordering": "0",
      "created_at": "2026-11-12 09:45:00",
      "modified_at": "2026-11-12 09:45:00",
      "created_by": "1",
      "modified_by": "1",
      "required_title": "Algebra Basics",
      "dangling": false
    },
    {
      "id": "4",
      "exam_id": "7",
      "required_exam_id": "6",
      "requirement": "score",
      "min_percent": "70.00",
      "ordering": "1",
      "created_at": "2026-11-12 09:45:00",
      "modified_at": "2026-11-12 09:45:00",
      "created_by": "1",
      "modified_by": "1",
      "required_title": "Fractions Quiz",
      "dangling": false
    }
  ]
}
Field Type Meaning
data[].required_exam_id string The exam that must come first
data[].requirement string passed, attempted or score
data[].min_percent string|null The score needed, for score only. null otherwise
data[].ordering string Position in the list, from 0
data[].required_title string|null The required exam’s title, null when that exam no longer exists
data[].dangling boolean true when the required exam no longer exists or is in the trash. Such a rule is listed so you can fix it, but no longer applies

Errors

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-exam/v1/exams/7/prerequisites" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/exams/7/prerequisites');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Basic ' . base64_encode(getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD')),
    ],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-exam/v1/exams/7/prerequisites', {
  headers: {
    'Authorization': 'Basic ' + btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share