Contents
On this page

List Subjects - Plugixa Exam

GET /plugixa-exam/v1/subjects

List subjects as a flat, paged list. For the nested hierarchy, use Get Subject Tree.

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

Note. lookups:read does not open this endpoint. It covers the subject tree, not this flat list.

Request

GET https://your-site.example/wp-json/plugixa-exam/v1/subjects?search=alg&orderby=title&order=asc

Query parameters

This endpoint takes only the list parameters every paged list accepts.

  • search matches title and code.
  • orderby accepts id, title, code, ordering, created_at and modified_at.

Responses

200 OK. data is a page of subjects.

{
  "success": true,
  "data": [
    {
      "id": 12,
      "parent_id": 3,
      "path": "3/12",
      "level": 2,
      "code": "MATH-ALG",
      "title": "Algebra",
      "slug": "algebra",
      "description": "",
      "ordering": 4,
      "published": true,
      "created_at": "2026-11-12 09:30:00",
      "modified_at": "2026-11-12 09:30:00",
      "created_by": 1,
      "modified_by": 1,
      "deleted_at": null
    },
    {
      "id": 15,
      "parent_id": 12,
      "path": "3/12/15",
      "level": 3,
      "code": null,
      "title": "Linear equations",
      "slug": "linear-equations",
      "description": "",
      "ordering": 1,
      "published": false,
      "created_at": "2026-11-12 09:42:10",
      "modified_at": "2026-11-12 09:42:10",
      "created_by": 1,
      "modified_by": 1,
      "deleted_at": null
    }
  ],
  "meta": {
    "total": 2,
    "pages": 1
  }
}
Field Type Meaning
data[].id integer The subject’s id
data[].parent_id integer 0 at the top level
data[].path string The ids from the top level down to this subject
data[].level integer Depth, from 1
data[].code string|null Your reference, or null
data[].ordering integer Position among its siblings
data[].published boolean Whether the subject is published
data[].deleted_at string|null null unless the subject is in the trash (view=trash)
meta.total integer Subjects matching, across all pages
meta.pages integer Number of pages at this per_page

Errors

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-exam/v1/subjects?search=alg&orderby=title&order=asc" \
  -H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/subjects?search=alg&orderby=title&order=asc');
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 response = await fetch('https://your-site.example/wp-json/plugixa-exam/v1/subjects?search=alg&orderby=title&order=asc', {
  headers: {
    'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
  },
});
const { data, meta } = await response.json();

Quick Links

Share