User schema#

Note

This is only available on Plone 5.

Users in Plone have a set of properties defined by a default set of fields such as fullname, email, portrait, and so on. These properties define the site user's profile and the user itself via the Plone UI, or the site managers can add them in a variety of ways including PAS plugins.

These fields are dynamic and customizable by integrators so they do not adhere to a fixed schema interface. This dynamic schema is exposed by this endpoint in order to build the user's profile form.

Getting the user schema#

To get the current user schema, make a request to the /@userschema endpoint.

http

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

curl

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

httpie

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

python-requests

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

The server will respond with the user schema.

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

{
    "fieldsets": [
        {
            "behavior": "plone",
            "fields": [
                "fullname",
                "email",
                "home_page",
                "description",
                "location",
                "portrait"
            ],
            "id": "default",
            "title": "Default"
        }
    ],
    "properties": {
        "description": {
            "description": "\n          A short overview of who you are and what you do. Will be displayed on your author page, linked from the items you create.\n      ",
            "factory": "Text",
            "title": "Biography",
            "type": "string",
            "widget": "textarea"
        },
        "email": {
            "description": "We will use this address if you need to recover your password",
            "factory": "Email",
            "title": "Email",
            "type": "string",
            "widget": "email"
        },
        "fullname": {
            "description": "Enter full name, e.g. John Smith.",
            "factory": "Text line (String)",
            "title": "Full Name",
            "type": "string"
        },
        "home_page": {
            "description": "\n          The URL for your external home page, if you have one.\n      ",
            "factory": "URL",
            "title": "Home page",
            "type": "string",
            "widget": "url"
        },
        "location": {
            "description": "\n          Your location - either city and country - or in a company setting, where your office is located.\n      ",
            "factory": "Text line (String)",
            "title": "Location",
            "type": "string"
        },
        "portrait": {
            "description": "\n          To add or change the portrait: click the \"Browse\" button; select a picture of yourself. Recommended image size is 75 pixels wide by 100 pixels tall.\n      ",
            "factory": "Image",
            "properties": {
                "portrait.contentType": {
                    "default": "",
                    "description": "The content type identifies the type of data.",
                    "factory": "Text line (String)",
                    "title": "Content Type",
                    "type": "string"
                },
                "portrait.data": {
                    "default": "",
                    "description": "The actual content of the object.",
                    "factory": "Text line (String)",
                    "title": "Data",
                    "type": "string"
                },
                "portrait.filename": {
                    "description": "",
                    "factory": "Text line (String)",
                    "title": "Filename",
                    "type": "string"
                }
            },
            "title": "Portrait",
            "type": "object"
        }
    },
    "required": [
        "email"
    ],
    "type": "object"
}

The user schema uses the same serialization as the type's JSON schema.

See Types Schema for detailed documentation about the available field types.