Contents
Delete Exam - Plugixa Exam
DELETE /plugixa-exam/v1/exams/{id}
Move an exam to the trash. It stops appearing in single reads and in lists, unless you ask for view=trash.
Scope exams:delete; the token’s user needs the exams:delete permission.
Note. The exam’s attempts are kept, but once the exam is in the trash, Get Attempt answers
404for them.
Request
DELETE https://your-site.example/wp-json/plugixa-exam/v1/exams/7
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The exam’s id |
Responses
200 OK. The exam is in the trash.
{
"success": true,
"data": {
"deleted": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.deleted |
boolean |
Always true |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_exam_not_found |
No exam has this id, or the exam is already in the trash. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-exam/v1/exams/7" \
-H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/exams/7');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
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/exams/7', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
},
});
const { data } = await response.json();
Quick Links
Share