Contents
On this page

Delete Passage - Plugixa Exam

DELETE /plugixa-exam/v1/passages/{id}

Unlink every question from a passage, then move the passage to the trash.

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 questions:delete permission.

Needs Plugixa Exam Pro, with the Passages app on in Plugixa Exam -> App Manager.

Note. The questions themselves are kept; they simply no longer show the passage. A paper already in progress can still read the trashed passage, while a paper started afterwards no longer depends on it.

Request

DELETE https://your-site.example/wp-json/plugixa-exam/v1/passages/7

Path parameters

Name Type Description
id integer The passage’s id

Responses

200 OK. The passage is unlinked and 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 passage with that id, or the passage 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/passages/7" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/passages/7');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    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/passages/7', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic ' + btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share