Contents
On this page

Get Bunny Video - Plugixa Stream

GET /plugixa-stream/v1/admin/bunny/videos/{guid}

Ask Bunny how far a video’s encoding is, and its length and thumbnail once known.

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

Request

GET https://your-site.example/wp-json/plugixa-stream/v1/admin/bunny/videos/0b3e6f1a-2c4d-4e8f-9a1b-3c5d7e9f1a2b

Path parameters

Name Type Description
guid string The Bunny video GUID

Responses

200 OK.

{
  "success": true,
  "data": {
    "status": 4,
    "ready": true,
    "duration": 1134,
    "thumbnail": "https://vz-1a2b3c4d-5e6.b-cdn.net/0b3e6f1a-2c4d-4e8f-9a1b-3c5d7e9f1a2b/thumbnail.jpg"
  }
}
Field Type Meaning
data.status integer Bunny’s status code: 4 finished, 3 transcoding
data.ready boolean Playable: status 3 or 4
data.duration integer Seconds
data.thumbnail string Bunny’s thumbnail, or empty

Errors

Status Code When
401 / 403 plugixa_stream_forbidden The caller lacks the capability.
400 plugixa_stream_bunny_setup The library ID or API key is missing.
502 plugixa_stream_bunny Bunny refused the key or answered with an error, for example an unknown GUID.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-stream/v1/admin/bunny/videos/0b3e6f1a-2c4d-4e8f-9a1b-3c5d7e9f1a2b" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-stream/v1/admin/bunny/videos/0b3e6f1a-2c4d-4e8f-9a1b-3c5d7e9f1a2b');
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/bunny/videos/0b3e6f1a-2c4d-4e8f-9a1b-3c5d7e9f1a2b', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share