Contents
On this page

Reorder Episodes - Plugixa Stream

POST /plugixa-stream/v1/admin/series/{id}/episodes/reorder

Put a title’s episodes in a new order and renumber them 1, 2, 3 and so on.

Needs a user with the plugixa_stream_edit capability (signed in with an Application Password or the login cookie). Administrators hold it; other roles only when you grant it.

Request

POST https://your-site.example/wp-json/plugixa-stream/v1/admin/series/2814/episodes/reorder

Path parameters

Name Type Description
id integer The title’s id

Request body

Content type: application/json

Field Type Required Description
ids integer[] Yes Episode ids in their new order. Ids of other titles are ignored; episodes you leave out follow, in their current order.
{
  "ids": [2816, 2815, 2817]
}

Responses

200 OK. data is the renumbered list.

The same answer as List Episodes.

{
  "success": true,
  "data": [
    {
      "id": 2816,
      "series_id": 2814,
      "number": 1,
      "title": "Chapter 2: The Tunnel of Terror",
      "description": "",
      "status": "publish",
      "publish_at": "",
      "url": "https://your-site.example/episode/flash-gordon-ep-1/",
      "season": 1,
      "provider": "self_hosted",
      "asset_id": "https://archive.org/download/flash-gordon-1936/chapter-1.mp4",
      "duration": 1134,
      "thumbnail_id": 0,
      "access": "auto",
      "price_override": null,
      "intro_start": null,
      "intro_end": null,
      "credits_start": null,
      "thumbnail_url": "",
      "subtitles": [],
      "audio_tracks": []
    }
  ]
}

Errors

Status Code When
401 / 403 plugixa_stream_forbidden The caller lacks the capability.
404 plugixa_stream_not_found No title with that id.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-stream/v1/admin/series/2814/episodes/reorder" \
  -u "$WP_USER:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"ids":[2816,2815,2817]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/series/2814/episodes/reorder');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'ids' => [2816, 2815, 2817],
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-stream/v1/admin/series/2814/episodes/reorder', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ ids: [2816, 2815, 2817] }),
});
const { data } = await response.json();

Quick Links

Share