Logotype Sitevision Developer
Log in
Log in

Intranet search integrations

RESTApps provide a powerful way to extend the functionality of the intranet search module, enabling the creation of custom integrations tailored to specific needs.

These integrations can be easily managed through the module’s configuration settings. By selecting a configured RESTApp, it becomes an integral part of the search experience, appearing as a dedicated tab in the search results. This allows for seamless integration of external data or services, enhancing the overall usability and flexibility of the search module.

Endpoint

To enable the integration, the RESTApp must expose a GET /search endpoint, which the intranet search module will call internally whenever a user submits a query.

Parameters

The /search endpoint will receive the following parameters:

Parameters

Property

Type

Description

query

string

The main search query

skip

number

The number of results to skip (for pagination)

max

number

The maximum number of results to return

 

Response

The /search endpoint should return a status code and a JSON object.

If successful, it should return status 200 along with the following response:

Response

Property

Type

Description

items

array<{ type:string, url:string, name:string, lastModifiedDate?:string/number, fileSize?:string, path: string, description:string }>

Array of search hit objects

hasMore

boolean

Boolean indicating if more results are available

effectiveCount

number

Number of total search hits

Item structure

The objects in the items array can include the following properties. While the intranet search module supports all these properties, they are not all mandatory.

Item properties

Property

Type

Description

type

string

Item type. One of "file" or "page"

url

string

Url for link to file/page

name

string

Name of file/page

lastModifiedDate

string/number

Date when file was last modified. Format must be handled by Date(), e.g. ISO 8601 or timestamp
Only for type:"file"

fileSize

string

Size of file
Only for type:"file"

path

string

Path for file/page

description

string

Description of file/page

Example

Error Responses

500 internal server error

Use if configuration is missing or if there is an internal server error

500 internal server error

Property

Type

Description

message

string

Message for users

Example

401 unauthorized

Use if the request lacks necessary permissions or authentication (e.g., when using OAuth2 authentication)

401 unauthorized

Property

Type

Description

message

string

Message for users

buttonText

string

Text for authorization button

link

string

Link for redirection to the login/authorization page

Example

400 bad request

Use if the request parameters are missing or invalid

400 bad request

Property

Type

Description

message

string

Message for users

Example

Example

Display name

To allow editors to specify a custom name for the integration displayed in the search results, a GET /display-name endpoint can be implemented. This endpoint should return an object containing a displayName, which can ideally be retrieved from appData.

If the endpoint is missing, returns an empty string, or null, the integration name will default to the name property in manifest.json.

Response

displayName

string

String with display name for integration

Example

Did you find the content on this page useful?