Contents
On this page
Remove Passage Audio - Plugixa Exam
DELETE /plugixa-exam/v1/passages/{id}/audio
Delete a passage’s recording. The passage, its text and its transcript stay.
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:edit permission.
Needs Plugixa Exam Pro, with the Passages app on in Plugixa Exam -> App Manager.
Note. The file is deleted from the server, not trashed: it cannot be brought back. A passage that has no recording also answers
200.
Request
DELETE https://your-site.example/wp-json/plugixa-exam/v1/passages/7/audio
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The passage’s id |
Responses
200 OK. The passage no longer has a recording.
{
"success": true,
"data": {
"has_audio": false,
"audio_name": "",
"audio_seconds": 0
}
}
| Field | Type | Meaning |
|---|---|---|
data.has_audio |
boolean |
Always false |
data.audio_name |
string |
Always empty |
data.audio_seconds |
integer |
Always 0 |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_exam_not_found |
No passage with that id, or the passage is 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/audio" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-exam/v1/passages/7/audio');
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/audio', {
method: 'DELETE',
headers: {
'Authorization': 'Basic ' + btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share