Contents
On this page

Update Integration - Plugixa Permalink Manager

PUT /plugixa-permalink-manager/v1/integrations/{id}

Switch one integration on or off. An integration that is off registers nothing from the next request on.

Needs the plugixa_permalink_manager_manage_settings capability. POST and PATCH are accepted too.

Request

PUT https://your-site.example/wp-json/plugixa-permalink-manager/v1/integrations/woocommerce

Path parameters

Name Type Description
id string The integration id, from List Integrations

Request body

Content type: application/json

Field Type Required Description
enabled boolean Yes true to switch it on, false to switch it off.
{
  "enabled": false
}

Responses

200 OK. data is the integration’s card.

{
  "success": true,
  "data": {
    "id": "woocommerce",
    "name": "WooCommerce",
    "description": "Custom permalinks for products and product categories, with the shop page and account endpoints kept working.",
    "features": [
      "Products, categories, tags and attributes",
      "Shop page at any address",
      "SKU and attribute tags"
    ],
    "screen": "/permastructures",
    "detected": true,
    "enabled": false,
    "running": false
  }
}
Field Type Meaning
data object The card, in the shape of List Integrations

Errors

Status Code When
404 plugixa_permalink_manager_not_found No integration with that id.
400 rest_missing_callback_param enabled is missing.
400 rest_invalid_param enabled is not a boolean.

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share