Transactions#

The @transactions endpoint exposes transactions that have been made through the Plone website. Each change through the Plone website is listed. It also allows to revert transactions so that the Plone website can be reverted to a previous state.

Listing the Transactions of a Content Object#

Listing versions and transactions of a resource:

http

GET /plone/@transactions HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i -X GET http://nohost/plone/@transactions -H "Accept: application/json" --user admin:secret

httpie

http http://nohost/plone/@transactions Accept:application/json -a admin:secret

python-requests

requests.get('http://nohost/plone/@transactions', headers={'Accept': 'application/json'}, auth=('admin', 'secret'))
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "description": "/Plone/news/aggregator/POST_application_json_@lock",
        "id": "QStrR2EwMVdzM2M9",
        "size": 2439,
        "time": "2022-06-19T23:49:18",
        "username": " admin"
    },
    {
        "description": "/Plone/POST_application_json_@login",
        "id": "QStrR1psT2s1aUk9",
        "size": 4809,
        "time": "2022-06-19T23:44:19",
        "username": " admin"
    },
    {
        "description": "/Plone/document_view",
        "id": "QStrR0VEY2hva1E9",
        "size": 4496,
        "time": "2022-06-19T22:18:12",
        "username": " admin"
    },
    {
        "description": "/plone-addsite",
        "id": "QStrR0VDeG84d0E9",
        "size": 2971990,
        "time": "2022-06-19T22:18:10",
        "username": " admin"
    },
    {
        "description": "/plone-addsite",
        "id": "QStrR0R4eUFJWms9",
        "size": 3637,
        "time": "2022-06-19T22:17:06",
        "username": " admin"
    },
    {
        "description": "Added default view for root object",
        "id": "QStrR0RRc0M5TjA9",
        "size": 2216,
        "time": "2022-06-19T22:15:02",
        "username": ""
    },
    {
        "description": "Added virtual_hosting",
        "id": "QStrR0RRcTVrbFU9",
        "size": 1369,
        "time": "2022-06-19T22:15:02",
        "username": ""
    },
    {
        "description": "Added site error_log at /error_log",
        "id": "QStrR0RRcVh4cGs9",
        "size": 1130,
        "time": "2022-06-19T22:15:02",
        "username": ""
    },
    {
        "description": "Added session_data_manager",
        "id": "QStrR0RRcDlFaUk9",
        "size": 1405,
        "time": "2022-06-19T22:15:02",
        "username": ""
    },
    {
        "description": "Added browser_id_manager",
        "id": "QStrR0RRcFU2KzQ9",
        "size": 840,
        "time": "2022-06-19T22:15:02",
        "username": ""
    },
    {
        "description": "Created initial user",
        "id": "QStrR0RRbUkzKzQ9",
        "size": 403,
        "time": "2022-06-19T22:15:02",
        "username": ""
    },
    {
        "description": "",
        "id": "QStrR0RRbEVVa1E9",
        "size": 717,
        "time": "2022-06-19T22:15:02",
        "username": ""
    },
    {
        "description": "initial database creation",
        "id": "QStrR0ROWlo5YW89",
        "size": 154,
        "time": "2022-06-19T22:14:50",
        "username": ""
    }
]

The following fields are returned:

username

The person who made the transactions through the website.

time

The time when the transaction was made through the website.

description

The description of the transaction with the path where the transaction was made in the website.

id

The transaction ID.

size

The size of the transaction in bytes.

Reverting a Transaction or a group of Transactions#

Reverting a single transaction or a group of transactions can be done by sending a PATCH request to the @transactions endpoint with a list of transaction IDs you want to revert:

http

PATCH /plone/@transactions HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0
Content-Type: application/json

{
    "transaction_ids": ["QStvcExLS1ZiRlU9"]
}

curl

curl -i -X PATCH http://nohost/plone/@transactions -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"transaction_ids": ["QStvcExLS1ZiRlU9"]}' --user admin:secret

httpie

echo '{
  "transaction_ids": [
    "QStvcExLS1ZiRlU9"
  ]
}' | http PATCH http://nohost/plone/@transactions Accept:application/json Content-Type:application/json -a admin:secret

python-requests

requests.patch('http://nohost/plone/@transactions', headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, json={'transaction_ids': ['QStvcExLS1ZiRlU9']}, auth=('admin', 'secret'))
HTTP/1.1 200 OK
Content-Type: application/json

{
  "message": "Transactions has been reverted successfully."
}