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:
Property | Type | Description |
---|---|---|
| string | The main search query |
| number | The number of results to skip (for pagination) |
| 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:
Property | Type | Description |
---|---|---|
| array<{ type:string, url:string, name:string, lastModifiedDate?:string/number, fileSize?:string, path: string, description:string }> | Array of search hit objects |
| boolean | Boolean indicating if more results are available |
| 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.
Property | Type | Description |
---|---|---|
| string | Item type. One of "file" or "page" |
| string | Url for link to file/page |
| string | Name of file/page |
| string/number | Date when file was last modified. Format must be handled by Date(), e.g. ISO 8601 or timestamp |
| string | Size of file |
| string | Path for file/page |
| 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
Property | Type | Description |
---|---|---|
| string | Message for users |
Example
401 unauthorized
Use if the request lacks necessary permissions or authentication (e.g., when using OAuth2 authentication)
Property | Type | Description |
---|---|---|
| string | Message for users |
| string | Text for authorization button |
| string | Link for redirection to the login/authorization page |
Example
400 bad request
Use if the request parameters are missing or invalid
Property | Type | Description |
---|---|---|
| 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.
| string | String with display name for integration |