Contents
Delete Video - Plugixa Video
DELETE /pvx/v1/videos/{id}
Move a video to the WordPress trash. It disappears from the site and the lists, and can be restored from the trash.
Needs a user (signed in with an Application Password or the login cookie) who has the plugixa_video_delete capability and the right to delete this video. In the free plugin only administrators hold it; with Pro, editors and the Video Creator role hold it too.
Note. A video that is already in the trash answers
500plugixa_video_delete_failedwhen deleted again. The API cannot empty the trash.
Request
DELETE https://your-site.example/wp-json/pvx/v1/videos/838
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The video’s id |
Responses
200 OK. The video is in the trash.
{
"success": true,
"data": {
"id": 838
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The id of the video moved to the trash |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_video_not_found |
No video with that id. |
401 / 403 |
plugixa_video_forbidden |
The caller may not delete this video. |
500 |
plugixa_video_delete_failed |
WordPress could not move it to the trash, for example because it is there already. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/pvx/v1/videos/838" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/pvx/v1/videos/838');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 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/pvx/v1/videos/838', {
method: 'DELETE',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share