Customize the Microsoft 365 Search or ServiceNow Search Using the Search Settings API

Learn how to customize your Microsoft 365 Search or ServiceNow Search integration based on your organization's needs.

Employee App
Staffbase Intranet
beta

The redesigned 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 customize search results from:

  • Specific SharePoint sites in Microsoft 365 Search integration
  • Specific knowledge bases in ServiceNow Search integration

Prerequisites:

  • You have created anAPI token with an administrative access level via the Staffbase Studio.
  • You have the SharePoint site IDs of the sites you want to include in the Microsoft 365 searches.
  • You have the knowledge base IDs of the knowledge bases you want to include in the ServiceNow searches.

Update the Microsoft 365 search Update the Microsoft 365 search section with the relevant SharePoint site IDs to allow search results from only the specified SharePoint sites.

  • Make a PUT request to /search/settings/integration-sections/m365. In the request body schema, set the object customData with the identifier of the sites you want to include, separated by commas:
Terminal window
curl --location --request PUT 'https://exampleapp.staffbase.com/api/search/settings/integration-sections/m365' \
--header 'Authorization: Basic {Token}'
--header 'Content-Type: application/json' \
--data '{
"title": {
"de_DE": "Microsoft 365",
"en_US": "Microsoft 365"
},
"enabled": true,
"displayType": "standard",
"datePrefix": "updated",
"integration": "m365",
"pageSize": 10,
"orderId": 1,
"customData": {
"siteIds": "55981a-91aa-4d9f-ad6f-fecdab410b96,55981a-91aa-4d9f-ad6f-fecdab410b97,55981a-91aa-4d9f-ad6f-fecdab410b55"
}
}'

You get a 200 OK response that the search settings are updated. For request and response samples, see the Search Settings API.

Update the ServiceNow search section with the relevant knowledge base IDs to allow search results from only the specified knowledge bases.

  • Make a PUT request to /search/settings/integration-sections/serviceNow. In the request body schema, set the object customData with the identifier of the knowledge bases you want to include or the customized URL for the ServiceNow knowledge base URL, separated by commas:
Terminal window
curl --location --request PUT 'https://exampleapp.staffbase.com/api/search/settings/integration-sections/serviceNow' \
--header 'Authorization: Basic {Token}'
--header 'Content-Type: application/json' \
--data '{
"title": {
"de_DE": "ServiceNow",
"en_US": "ServiceNow"
},
"enabled": true,
"displayType": "standard",
"datePrefix": "updated",
"integration": "serviceNow",
"pageSize": 10,
"orderId": 1,
"customData": {
"kb": "0d3bbaed979c5214099bba1de053afe2,1ec43b21971c9214099bba1de053af82",
"knowledgeUrl":"https://my-instance.service-now.com/esc"
}
}'

You get a 200 OK response that the settings are updated. For request and response samples, see the Search Settings API.