Add-ons#

Add-on product records can be addressed through the @addons endpoint in a Plone site. In order to address a specific record, the profile ID has to be passed as a path segment, such as /plone/@addons/plone.session.

Reading or writing add-ons metadata requires 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 -X GET 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 -X GET 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?

The query string parameter upgradeable is available in case you want to query only the add-ons that have an upgrade step pending.

Installing an add-on#

An individual add-on 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 add-on#

An individual add-on 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 add-on#

An individual add-on 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

Install a profile of an add-on#

You can install a profile of a given add-on by issuing a POST to the given URL and providing the name of the profile like:

http

POST /plone/@addons/plone.restapi/import/testing-workflows HTTP/1.1
Accept: application/json
Authorization: Basic YWRtaW46c2VjcmV0

curl

curl -i -X POST http://nohost/plone/@addons/plone.restapi/import/testing-workflows -H "Accept: application/json" --user admin:secret

httpie

http POST http://nohost/plone/@addons/plone.restapi/import/testing-workflows Accept:application/json -a admin:secret

python-requests

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