Contents
On this page

Discard Autosave - Plugixa Image Map

DELETE /plugixa-image-map/v1/maps/{id}/autosave

Throw away the current user’s draft of a map.

Any signed-in user with the plugixa_image_map_edit capability. Administrators have every Plugixa Image Map capability; see Roles and permissions.

Note. The autosave slot belongs to the user making the request: each user has at most one draft per map, and nobody can read another user’s. Saving the map clears the saver’s draft. Discarding when there is no draft still answers 200.

Request

DELETE https://your-site.example/wp-json/plugixa-image-map/v1/maps/12/autosave

Path parameters

Name Type Description
id integer The map’s id

Responses

200 OK. The draft is gone.

{
  "success": true,
  "data": {
    "discarded": true
  }
}

Errors

Status Code When
404 plugixa_image_map_not_found No map with that id, or the map is in the trash.

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share