Contents
On this page

Delete Widget - Plugixa Chat

DELETE /plugixa-chat/v1/widgets/{id}

Move a widget to the trash. It stops appearing in lists and single reads, and can be brought back with Restore Widget.

The signed-in user needs the plugixa_chat_delete capability. Administrators have it.

Trashing clears the plugin’s cached widget data, so the widget stops being served.

Note. Deleting a widget that is already in the trash answers 200 again and stamps a new trash date.

Request

DELETE https://your-site.example/wp-json/plugixa-chat/v1/widgets/2

Path parameters

Name Type Description
id integer The widget’s id

Responses

200 OK. The widget is in the trash.

{
  "success": true,
  "data": {
    "trashed": true
  }
}
Field Type Meaning
data.trashed boolean Always true

Errors

Status Code When
404 plugixa_chat_not_found No widget has this id.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-chat/v1/widgets/2" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/widgets/2');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    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/plugixa-chat/v1/widgets/2', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share