Search Endpoint

The Search endpoint serves as the public gateway for our Simployer internal search engine. To access this endpoint, it is imperative to provide user context through the inclusion of the X-User or X-SasKey header parameter. This mechanism ensures that users only gain access to content relevant to their permissions, thus serving as a crucial security measure.

For practical testing of this endpoint, please refer to our Swagger documentation.

Contract Specification

Request Parameters

The following table delineates the parameters required for making a request to the API:

Parameter Type Required
X-User (header) GUID Yes/No
X-SasKey (header) GUID Yes/No
X-Culture (header) String: "en-US", "nb-NO", "sv-SE", "EN" Yes
searchString (query) String Yes
pageIndex (query) Integer Yes
pageSize (query) Integer Yes
handbookId (query) Integer No
contentTypes (query) Array of Integers No

Content Types Reference

Name Id
Folder 4
Articles 8
Url 16
File 32
FilePointer 16384

Response Structure

The API response is structured as a JSON object, providing detailed information related to the search query results.

Response Example

{
    "numberOfHits": 1,
    "hits": [
        {
            "id": 100028,
            "guid": "5aebc2d5-7957-44df-a55a-595ffae984da",
            "handbookId": 100020,
            "handbookTypeId": 16,
            "handbookName": "Lorem ipsum System",
            "type": 8,
            "name": "Audit Policy",
            "content": "Lorem ipsum <em>policy</em>"
        }
    ],
    "aggregatedHits": {
        "hitsPerType": {
            "Article": 1,
            "Folder": 1
        },
        "hitsPerHandbook": {
            "100020": {
                "id": 100020,
                "handbookTypeId": 16,
                "name": "Lorem ipsum System",
                "numberOfHits": 1
            }
        }
    }
}

Key Response Attributes

Interpretation Guidelines

SasKey Generation

One method to establish user context for searching is by employing SasKey, also recognized as read links. The following instructions outline how to generate a SasKey:

  1. Navigate to the Handbook Admin and proceed to the Settings page.

    Setting page

  2. Within the Settings page, access the Read access section. Click on the Create button located in the top-right corner, as depicted below.

    Create new client form

  3. Configure the scope of access for the SasKey by specifying parameters such as name, language, and selecting the relevant handbook and/or groups. This defines the content accessible to individuals authenticating with this token.

    Create new client form

Important Reminder

Ensure to check the Send link by email option for appropriate distribution.