Pages

Pages and Index Pages provide support for static content, directory style listings and individual detail pages.

Accessing Pages

All pages (and index pages) are accessed through a single endpoint. The path is a required parameter and the response will be a page config block and zero or more resources. (A page will have just one resources, an index page may have many.) User credentials are optional but may be required if the page is not public or is only for members.

path

required string. The URL path (after the domain name). All paths should end with a trailing slash.

http https://sls-api.sheepcrm.com/public/v2/$FLOCK/web/ path=="vehicle/"

Configuring index pages

Index pages can be lists of nearly any resource type. Lists of page_news will be automatically filtered to remove pages with a future publication date. Note: page_documents must be explcitly filtered as the publication date is an optional field for documents.

Filtering index pages

user_query

A dictionary of query terms which are merged with the base query for the index page (if present). Paging through results should be through page and page_size parameters in the user_query. The default page_size is 25.

The following fields are supported within the user_query:

creator

The document author

date_lower

The lower bound of the date range, this checks the document_date field.

date_upper

The upper bound of the date range, this checks the document_date field.

legacy_uid

The unique identifier for the document used when importing documents from other systems and where the ID is still useful.

tags

A list of tags to filter by.

title

The title of the document.

sort

Sort the results by title or date (default). To specify descending order for a field, prefix the field with a - e.g. -date

http POST https://sls-api.sheepcrm.com/public/v2/$FLOCK/web/ "Authorization: Bearer $APP_API_KEY" path=="vehicle/" user_query:='{"title": "Cardinal"}'

HTTP/1.1 200 OK

{
    "page_config": {
        "active": true,
        "body": null,
        "filter": {
            "mode": "AND",
            "page_size": 25
        },
        "legacy_uid": null,
        "path": "vehicle/",
        "public": false,
        "member_only": true,
        "resource_type": "vehicle",
        "tags": [],
        "template": "vehicle_directory",
        "title": "Vehicle Directory"
    },
    "path_elements": {},
    "query": {
        "title": "Cardinal",
        "mode": "AND",
        "page_size": 25
    },
    "resource_query": {
        "mode": "AND",
        "page_size": 25
    },
    "resources": [...],
    "user_context": {
        "contact_uri": "/example/person/60ec4daxxxxxxd7a884b12/",
        "is_logged_in": true,
        "is_member": false,
        "user_account": {
            "email": "james@sheepcrm.com",
            "first_name": "James",
            "last_login_date": "2021-07-26T15:41:17.925000",
            "last_name": "Webster",
            "session_expiry": "2021-07-27T03:41:17.925000",
            "uri": "/sheep-app/useraccount/5d8254xxxxxxcedeb87/",
            "username": "xxx"
        },
        "username": "xxx"
    },
    "user_query": {
        "title": "Cardinal"
    }
}