Contents
Delete Channel - Plugixa Video
DELETE /pvx/v1/channels/{id}
Move a channel to the WordPress 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 channel. In the free plugin only administrators hold it; with Pro, editors and the Video Creator role hold it too. Needs the Channels app on in Plugixa Video -> App manager; with it off, this route answers 404.
Note. The channel’s videos are not touched: they keep its id in
channel_id. A channel already in the trash answers500when deleted again.
Request
DELETE https://your-site.example/wp-json/pvx/v1/channels/692
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The channel’s id |
Responses
200 OK. The channel is in the trash.
{
"success": true,
"data": {
"id": 692
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The id of the channel moved to the trash |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_video_not_found |
No channel with that id. |
401 / 403 |
plugixa_video_forbidden |
The caller may not delete this channel. |
500 |
plugixa_video_delete_failed |
WordPress could not move it to the trash. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/pvx/v1/channels/692" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/pvx/v1/channels/692');
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/channels/692', {
method: 'DELETE',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share