Contents
On this page

Duplicate View - Plugixa Testimonial

POST /plugixatestimonial/v1/views/{id}/duplicate

Copy a view under the name “{name} (Copy)”. The copy is never the default.

Any signed-in user with the plugixa_testimonial_edit capability or WordPress’s edit_posts (Contributors and up, by default).

Request

POST https://your-site.example/wp-json/plugixatestimonial/v1/views/2/duplicate

Path parameters

Name Type Description
id integer The view’s id

Responses

200 OK. data.id is the copy.

{
  "success": true,
  "message": "View duplicated successfully",
  "data": {
    "id": 9
  }
}
Field Type Meaning
data.id integer The copy’s id
message string A human-readable confirmation, translated to the site language

Errors

Status Code When
404 rest_error No view with that id.
500 rest_error The database refused the insert.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixatestimonial/v1/views/2/duplicate" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixatestimonial/v1/views/2/duplicate');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixatestimonial/v1/views/2/duplicate', {
  method: 'POST',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share