Contents
Get Subject - Plugixa Exam
GET /plugixa-exam/v1/subjects/{id}
Get one subject by its id.
Scope subjects:read; the token’s user needs the subjects:view permission.
Request
GET https://your-site.example/wp-json/plugixa-exam/v1/subjects/12
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The subject’s id |
Responses
200 OK. data is the subject.
{
"success": true,
"data": {
"id": 12,
"parent_id": 3,
"path": "3/12",
"level": 2,
"code": "MATH-ALG",
"title": "Algebra",
"slug": "algebra",
"description": "<p>Equations, expressions and functions.</p>",
"ordering": 4,
"published": true,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 10:15:00",
"created_by": 1,
"modified_by": 1,
"deleted_at": null
}
}
| 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.slug |
string |
Unique slug |
data.description |
string|null |
HTML |
data.ordering |
integer |
Position among its siblings |
data.published |
boolean |
Whether the subject is published |
data.created_at |
string |
UTC datetime |
data.modified_at |
string |
UTC datetime of the last change |
data.created_by |
integer |
WordPress user id of the author |
data.deleted_at |
string|null |
Always null here: a subject in the trash answers 404 |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_exam_not_found |
No subject with that id, or the subject is in the trash. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-exam/v1/subjects/12" \
-H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/subjects/12');
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/12', {
headers: {
'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
},
});
const { data } = await response.json();
Quick Links
Share