Ctrl+K
Logo image

Table of Contents

  • Introduction
  • Usage
    • Authentication
    • Batching
    • Content Manipulation
    • Customizing the API
    • Expansion
    • Explore the API using Postman
    • i18n: internationalization of screen messages
    • Serialization
    • Sharing
    • Types Schema
    • Volto Blocks support
  • Endpoints
    • Add-ons
    • Aliases
    • Breadcrumbs
    • Comments
    • Content Types
    • Content Rules
    • Context Navigation
    • Control Panels
    • Copy and Move
    • Database
    • Email Notification
    • Email Send
    • Groups
    • History
    • Link Integrity
    • Locking
    • Navigation
    • Navigation root
    • Portal Actions
    • Portraits
    • Principals
    • Querystring
    • Querystring Search
    • Registry
    • Relations
    • Roles
    • Search
    • Site
    • System
    • Transactions
    • Translations
    • TUS resumable upload
    • Types
    • Upgrade
    • Users
    • User schema
    • Vocabularies and Sources
    • Workflow
    • Working Copy
  • Upgrade Guide
  • Contributing to plone.restapi
    • Conventions
  • HTTP Status Codes
  • Glossary
  • Repository
  • Suggest edit
  • Open issue
  • .md

Link Integrity

Link Integrity#

When you create relations between content objects in Plone (for example, via relation fields or links in text blocks), these relations are stored in the database. The Plone user interface will use those stored relations to show a warning when you try to delete a content object that is still referenced elsewhere. Link integrity avoids broken links ("breaches") in the site.

The @linkintegrity endpoint returns the list of reference breaches that would happen if some content items would be deleted. This information can be used to show the editor a confirmation dialog.

This check includes content objects that are located within a content object ("folderish content").

You can call the /@linkintegrity endpoint on the site root with a GET request and a list of content UIDs in the JSON body:

http

GET /plone/@linkintegrity?uids=SomeUUID000000000000000000000002 HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i -X GET 'http://nohost/plone/@linkintegrity?uids=SomeUUID000000000000000000000002' -H "Accept: application/json" --user admin:secret

httpie

http 'http://nohost/plone/@linkintegrity?uids=SomeUUID000000000000000000000002' Accept:application/json -a admin:secret

python-requests

requests.get('http://nohost/plone/@linkintegrity?uids=SomeUUID000000000000000000000002', headers={'Accept': 'application/json'}, auth=('admin', 'secret'))

The endpoint accepts a single parameter:

uids

A list of object UIDs that you want to check.

The server will respond with the result:

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "@id": "http://localhost:55001/plone/doc-2",
        "@type": "Document",
        "breaches": [
            {
                "@id": "http://localhost:55001/plone/doc-1",
                "title": "First document",
                "uid": "SomeUUID000000000000000000000001"
            }
        ],
        "description": "",
        "items_total": 0,
        "review_state": "private",
        "title": "Second document",
        "type_title": "Page"
    }
]

The result includes a list of objects corresponding to the UIDs that were requested. Each result object includes:

breaches

A list of breaches (sources of relations that would be broken)

items_total

Count of items contained inside the specified UIDs.

previous

History

next

Locking

© Copyright 2014-2023, Plone Foundation.

The text and illustrations in this website are licensed by the Plone Foundation under a Creative Commons Attribution 4.0 International license. Plone and the Plone® logo are registered trademarks of the Plone Foundation, registered in the United States and other countries. For guidelines on the permitted uses of the Plone trademarks, see https://plone.org/foundation/logo. All other trademarks are owned by their respective owners.

Deploys by Netlify