Contents
Get Viewer Video State - Plugixa Video
GET /pvx/v1/videos/{id}/me
Read what the watch page needs about the caller and one video: favorite, liked, subscribed to its channel, and which of their playlists hold it.
Any signed-in user (signed in with an Application Password or the login cookie). Signed out, it answers 401. Needs the Viewer library app on in Plugixa Video -> App manager; with it off, this route answers 404.
Note. The id is not checked: an unknown id answers
200with everythingfalseand the caller’s playlists.
Request
GET https://your-site.example/wp-json/pvx/v1/videos/838/me
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The video’s id |
Responses
200 OK.
{
"success": true,
"data": {
"favorite": true,
"liked": false,
"subscribed": true,
"playlists": [
{
"id": 1550,
"title": "Road trips"
},
{
"id": 1561,
"title": "Watch later"
}
],
"in": [1550]
}
}
| Field | Type | Meaning |
|---|---|---|
data.favorite |
boolean |
In the caller’s favorites |
data.liked |
boolean |
Liked by the caller |
data.subscribed |
boolean |
The caller follows the video’s channel |
data.playlists |
object[] |
Up to 100 of the caller’s playlists, {id, title} |
data.in |
integer[] |
Which of those playlists contain this video |
Errors
| Status | Code | When |
|---|---|---|
401 |
plugixa_video_login_required |
Signed out. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/pvx/v1/videos/838/me" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/pvx/v1/videos/838/me');
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/pvx/v1/videos/838/me', {
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share