Contents
On this page
Delete Question - Plugixa Exam
DELETE /plugixa-exam/v1/questions/{id}
Move a question to the trash.
Scope questions:delete; the token’s user needs the questions:delete permission.
This is a soft delete: the question’s options and its version history are kept. It stops appearing in Get Question and in List Questions, where view=trash still lists it.
Request
DELETE https://your-site.example/wp-json/plugixa-exam/v1/questions/12
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The question’s id |
Responses
200 OK. The question is in the trash.
{
"success": true,
"data": {
"deleted": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.deleted |
boolean |
Always true on success |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_exam_not_found |
No question with that id. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-exam/v1/questions/12" \
-H "Authorization: Bearer $PLUGIXA_EXAM_TOKEN"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/questions/12');
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/questions/12', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.PLUGIXA_EXAM_TOKEN}`,
},
});
const { data } = await response.json();
Quick Links
Share