Contents
On this page

Preview TMDB Title - Plugixa Stream

GET /plugixa-stream/v1/admin/tmdb/preview

What an import would bring, before anything is saved, and a show’s seasons for Import TMDB Season.

Needs a user with the plugixa_stream_create and plugixa_stream_edit capabilities and WordPress’s upload_files (signed in with an Application Password or the login cookie).

Request

GET https://your-site.example/wp-json/plugixa-stream/v1/admin/tmdb/preview?kind=tv&id=1514

Query parameters

Field Type Required Description
kind string Yes movie or tv.
id integer Yes The TMDB id.

Responses

200 OK.

{
  "success": true,
  "data": {
    "id": 1514,
    "kind": "tv",
    "title": "Flash Gordon",
    "synopsis": "Flash Gordon, Dale Arden and Dr. Zarkov rocket to the planet Mongo.",
    "year": 1936,
    "age_rating": "",
    "genres": ["Sci-Fi & Fantasy"],
    "poster": "https://image.tmdb.org/t/p/w342/flash.jpg",
    "banner": "https://image.tmdb.org/t/p/w780/flash-backdrop.jpg",
    "trailer": "",
    "seasons": [
      {
        "number": 1,
        "name": "Season 1",
        "episodes": 13
      }
    ]
  }
}
Field Type Meaning
data.year integer|null Release year
data.age_rating string The plugin’s rating, from TMDB’s for your region
data.genres string[] TMDB’s genre names
data.trailer string A trailer link, when TMDB has one
data.seasons object[] Shows only: number, name, episodes

Errors

Status Code When
401 / 403 plugixa_stream_forbidden The caller lacks one of the three capabilities.
422 plugixa_stream_invalid kind or id is missing or invalid.
404 plugixa_stream_not_found TMDB has nothing with that id.
422 plugixa_stream_tmdb_key No TMDB key is saved, or TMDB refused it.
502 plugixa_stream_tmdb TMDB could not be reached or answered oddly.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-stream/v1/admin/tmdb/preview?kind=tv&id=1514" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/tmdb/preview?kind=tv&id=1514');
curl_setopt_array($ch, [
    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/plugixa-stream/v1/admin/tmdb/preview?kind=tv&id=1514', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share