Page groups

Intro

A page group is a set of pages within your application.

A page is everything after the hostname in the URL; in other words, everything from the first / on. Pages can be represented by either a string or a Java standard regular expression.

Page groups are used by policies to determine if a visit triggers that policy. One page group can be used by multiple policies.

Page groups object

Sample object

{
    "type": "page_group",
    "id": "f28a67f5-a7b2-4813-afda-9db4fed045f4",
    "name": "internal",
    "page_visit_check": "ANY",
    "pages": [
        "/internal/.+",
        "/admin/console"
    ],
    "created": 1578018203208,
    "is_default": false
}

Attributes

typestring

String representing object type.

always value: "page_group"
idstring

Unique identifier for object.

namestring

Unique display name for object.

page_visit_checkstring

String representing how visits to pages in this group are counted.

Options:
  • "ANY": All visits are counted.
  • "UNVISITED": Only visits to unvisited pages are counted.
  • "UNVISITED_WITHOUT_QUERY": Only visits to unvisited pages, excluding the query string, are counted.
pagesarray

List of pages associated with this object. Pages may be an exact string or regular expression used to match the path in a URL. For example, in "https://www.nettoolkit.com/docs/gatekeeper/page-groups", the page would be "/docs/gatekeeper/page-groups". Limited to 20 results.

creatednumber

Timestamp of object creation in milliseconds.

is_defaultboolean

Whether the object is a system default. System defaults cannot be modified.

Endpoints

List page groups

GET/gatekeeper/page-groups

Examples

Example Request
curl "https://api.nettoolkit.com/v1/gatekeeper/page-groups" \
-H "X-NTK-KEY: $YOUR_KEY_HERE"
Example Response
{
    "code": 1000,
    "results": [
        {
            "type": "page_group",
            "id": "24214b95-aa8d-432a-9d4a-51a1785a6a35",
            "name": "protected",
            "page_visit_check": "UNVISITED",
            "pages": [
                "/protected/.+"
            ],
            "created": 1578018203208,
            "is_default": false
        }
    ]
}