Add-ons

Addon product records can be addressed through the @addons endpoint on the Plone site. In order to address a specific record, the profile id has to be passed as a path segment (e.g. /plone/@addons/plone.session).

Reading or writing addons metadata require the cmf.ManagePortal permission.

Reading add-ons records

Reading a single record:

http

GET /plone/@addons/plone.session HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i http://nohost/plone/@addons/plone.session -H 'Accept: application/json' --user admin:secret

httpie

http http://nohost/plone/@addons/plone.session Accept:application/json -a admin:secret

python-requests

requests.get('http://nohost/plone/@addons/plone.session', headers={'Accept': 'application/json'}, auth=('admin', 'secret'))

Example Response:

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

{
  "@id": "http://localhost:55001/plone/@addon/plone.session",
  "description": "Optional plone.session refresh support.",
  "profile_type": "default",
  "upgrade_profiles": {},
  "uninstall_profile_id": "plone.session:uninstall",
  "other_profiles": [],
  "is_installed": false,
  "id": "plone.session",
  "install_profile": {
    "product": "plone.session",
    "description": "Optional plone.session refresh support.",
    "for": null,
    "title": "Session refresh support",
    "pre_handler": null,
    "version": "1001",
    "type": 2,
    "id": "plone.session:default",
    "post_handler": null
  },
  "title": "Session refresh support",
  "uninstall_profile": {
    "product": "plone.session",
    "description": "Optional plone.session refresh support. [uninstall]",
    "for": null,
    "title": "Session refresh support [uninstall]",
    "pre_handler": null,
    "type": 2,
    "id": "plone.session:uninstall",
    "post_handler": null
  },
  "install_profile_id": "plone.session:default",
  "version": "3.7.0",
  "upgrade_info": {}
}

Listing add-ons records

A list of all add-ons in the portal can be retrieved by sending a GET request to the @addons endpoint:

http

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

curl

curl -i http://nohost/plone/@addons -H 'Accept: application/json' --user admin:secret

httpie

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

python-requests

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

Response:

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

{
  "@id": "http://localhost:55001/plone/@addons",
  "items": [
    {
      "description": "Optional plone.session refresh support.",
      "profile_type": "default",
      "upgrade_profiles": {},
      "uninstall_profile_id": "plone.session:uninstall",
      "other_profiles": [],
      "is_installed": "FALSE",
      "id": "plone.session",
      "install_profile": {
        "product": "plone.session",
        "description": "Optional plone.session refresh support.",
        "for": "NULL",
        "title": "Session refresh support",
        "pre_handler": "NULL",
        "version": "1001",
        "type": 2,
        "id": "plone.session:default",
        "post_handler": "NULL"
      },
      "title": "Session refresh support",
      "uninstall_profile": {
        "product": "plone.session",
        "description": "Optional plone.session refresh support. [uninstall]",
        "for": "NULL",
        "title": "Session refresh support [uninstall]",
        "pre_handler": "NULL",
        "type": 2,
        "id": "plone.session:uninstall",
        "post_handler": "NULL"
      },
      "install_profile_id": "plone.session:default",
      "version": "3.7.0",
      "upgrade_info": {}
    }
  ],
  "items_total": 16
}

The following fields are returned:

  • @id: hypermedia link to the control panel
  • id: the name of the add-on package
  • title: the friendly name of the add-on package
  • description: description of the add-on
  • version: the current version of the add-on
  • is_installed: is the add-on installed?
  • has_uninstall_profile: does the add-on have an uninstall profile

Installing an addon

An individual addon can be installed by issuing a POST to the given URL:

http

POST /plone/@addons/plone.session/install HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i -X POST http://nohost/plone/@addons/plone.session/install -H 'Accept: application/json' --user admin:secret

httpie

http POST http://nohost/plone/@addons/plone.session/install Accept:application/json -a admin:secret

python-requests

requests.post('http://nohost/plone/@addons/plone.session/install', headers={'Accept': 'application/json'}, auth=('admin', 'secret'))
HTTP/1.1 204 No Content

Uninstalling an addon

An individual addon can be uninstalled by issuing a POST to the given URL:

http

POST /plone/@addons/plone.session/uninstall HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i -X POST http://nohost/plone/@addons/plone.session/uninstall -H 'Accept: application/json' --user admin:secret

httpie

http POST http://nohost/plone/@addons/plone.session/uninstall Accept:application/json -a admin:secret

python-requests

requests.post('http://nohost/plone/@addons/plone.session/uninstall', headers={'Accept': 'application/json'}, auth=('admin', 'secret'))
HTTP/1.1 204 No Content

Upgrading an addon

An individual addon can be upgraded by issuing a POST to the given URL:

http

POST /plone/@addons/plone.session/upgrade HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i -X POST http://nohost/plone/@addons/plone.session/upgrade -H 'Accept: application/json' --user admin:secret

httpie

http POST http://nohost/plone/@addons/plone.session/upgrade Accept:application/json -a admin:secret

python-requests

requests.post('http://nohost/plone/@addons/plone.session/upgrade', headers={'Accept': 'application/json'}, auth=('admin', 'secret'))
HTTP/1.1 204 No Content