Pages

Pages and Index Pages provide support for static content, dirctory 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/api/v2/public/$FLOCK/web/ path=="vehicle/"

Filtering index pages

user_query

A dictionary of query terms which are merged with the base query for the index page (if present). The following fields are supported: creator, date_lower, date_upper, legacy_uid, tags & title Paging through results should be through page and page_size parameters in the user_query. The default page_size is 25.

http POST https://sls-api.sheepcrm.com/api/v2/public/$FLOCK/web/ "Authorization: Bearer $APP_API_KEY" path=="vehicle/" user_query:='{"colour": "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": {
        "colour": "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": {
        "colour": "Cardinal"
    }
}