Contents
On this page

Delete Several Requests - Plugixa Testimonial

DELETE /plugixatestimonial/v1/requests/bulk-delete

Delete several requests for good in one request.

Administrators only: the user needs WordPress’s manage_options capability. No plugin capability opens this route.

Request

DELETE https://your-site.example/wp-json/plugixatestimonial/v1/requests/bulk-delete

Request body

Content type: application/json

Field Type Required Description
ids integer[] Yes Request ids. Ids that match nothing are ignored.
{
  "ids": [
    15,
    16
  ]
}

Responses

200 OK.

{
  "success": true,
  "message": "Requests deleted.",
  "data": null
}
Field Type Meaning
message string A human-readable confirmation, translated to the site language

The answer does not say how many were deleted.

Errors

Status Code When
400 rest_error “IDs are required.”

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixatestimonial/v1/requests/bulk-delete" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"ids":[15,16]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixatestimonial/v1/requests/bulk-delete');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'ids' => [15, 16],
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixatestimonial/v1/requests/bulk-delete', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ ids: [15, 16] }),
});
const { data } = await response.json();

Quick Links

Share