Contents
On this page

Test Mirror - Plugixa Activity Log

POST /plugixa-activity-log/v1/mirrors/{id}/test

Send one test event to a mirror, now, and report whether it got through.

Needs settings access (see who can call what). Needs Plugixa Activity Log Pro, with the Mirrors module on under Plugixa Activity Log -> Monitors.

Note. A failed delivery is not an HTTP error. The request answers 200 whatever happens: read ok. The test is sent even when the mirror is disabled, and ignores its filters.

The test event has the code 0, the action test, the object type mirror with the mirror’s id and name, your login as the user, and {"test": true} as its context. It goes out the same way real events do: to the syslog server, as a JSON POST to the HTTPS address (with the bearer token, if any), or into today’s file. It is not written to the log.

Request

POST https://your-site.example/wp-json/plugixa-activity-log/v1/mirrors/3/test

Path parameters

Name Type Description
id integer The mirror’s id

Request body

None.

Responses

200 OK. data says whether the test event was delivered.

{
  "success": true,
  "data": {
    "ok": true,
    "message": "The test event was delivered."
  }
}
Field Type Meaning
data.ok boolean Whether the destination accepted the event
data.message string The test event was delivered., or why it failed

Errors

Status Code When
404 plugixa_activity_log_not_found No mirror with that id.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-activity-log/v1/mirrors/3/test" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-activity-log/v1/mirrors/3/test');
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 auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const response = await fetch('https://your-site.example/wp-json/plugixa-activity-log/v1/mirrors/3/test', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share