Contents
On this page

Unlike Video - Plugixa Video

DELETE /pvx/v1/videos/{id}/like

Take back the caller’s like.

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: any id answers 200, with likes at 0 for an id that is not a video.

Request

DELETE 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": false,
    "likes": 37
  }
}
Field Type Meaning
data.liked boolean false
data.likes integer The video’s like count now

Errors

Status Code When
401 plugixa_video_login_required Signed out.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "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  => 'DELETE',
    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: 'DELETE',
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share