The search results page offers greater flexibility, allowing you to tailor the search experience to your business needs.
This article explains how to use the Search Settings API to:
- Hide the search flyout, which displays results from the Staffbase platform
- Configure a custom redirect URL
With this setup, when users enter a search term, they are redirected to the specified URL, such as your federated search page, together with the search query.
Prerequisites:
- You have created an API token with an administrative access level via the Staffbase Studio.
- You have the redirect URL to which you want to direct the users when they enter a keyword in the Staffbase Search.
Update the general settings In the general settings of the search settings page, you can hide the search flyout and provide the custom redirect URL to which you want to direct your users.
- Make a
PUT
request to/search/settings/general
. In the request body schema, set the following:
Parameters
Parameter | Action |
---|---|
localizations | Define the object that contains localization strings of the search title. |
showFlyout | Set it as false . |
redirectUrl | Provide the URL to which you want to redirect the users for search. |
Example request
curl --location --request PUT 'https://exampleapp.staffbase.com/api/search/settings/general' \--header 'Authorization: Basic {Token}'--header 'Content-Type: application/json' \--data-raw '{ "localizations": { "de_DE": { "title": "Suchen" }, "en_US": { "title": "Search" } }, "showFlyout": false, "redirectUrl": "https://some-url.here/search?q={query}"}'
You get a 200 OK response that the search settings are updated. For request and response samples, see the Search Settings API.