Contents
Like Video - Plugixa Video
POST /pvx/v1/videos/{id}/like
Like a video. The like count is public; liking twice counts once.
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.
Request
POST https://your-site.example/wp-json/pvx/v1/videos/838/like
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The video’s id |
Responses
200 OK.
{
"success": true,
"data": {
"liked": true,
"likes": 38
}
}
| Field | Type | Meaning |
|---|---|---|
data.liked |
boolean |
true |
data.likes |
integer |
The video’s like count now |
Errors
| Status | Code | When |
|---|---|---|
401 |
plugixa_video_login_required |
Signed out. |
404 |
plugixa_video_not_found |
No video with that id, or a draft, pending or private video the caller may not edit. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/pvx/v1/videos/838/like" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/pvx/v1/videos/838/like');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
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/like', {
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share