Skip to main content

Federated Search

Bettermode empowers apps to improve community search results by enabling federated search capabilities. To get started, simply set a federated search URL for your app through the developer portal.

To enable federated search, you should go to the "Federated search" section of your app under Bettermode developer portal and enter a federated search URL.

When a member searches for a query in the community, Bettermode will combine community search results with the results provided by your app's federated search URL and display them to the member.

note

Don't have an app yet? Follow the instructions here.

Federated search

Request

For every keyword that a user searches for in the community search bar, Bettermode sends a request following the structure outlined below:

{
"networkId": "ph0Mjn78U5",
"context": "NETWORK",
"currentSettings": [],
"type": "FEDERATED_SEARCH",
"data": {
"query": "Bettermode" // This the query user has searched for
}
}

Verifying requests

To make sure the requests are being sent from Bettermode, you need to verify all federated search requests using X-Tribe-Signature. You can learn more about this under Verifying Webhook Requests section.

danger

Not verifying federated search requests will let third parties misuse your webhook endpoint by faking POST requests and can be dangerous.

Responding to requests

To respond the federated search requests, you should send back a JSON response as followed:

HTTP 200 OK
Content-type: application/json
{
"type": "FEDERATED_SEARCH",
"status": "SUCCEEDED",
"data": [
{
"id": "n78U5n28Up",
"title": "Bettermode community",
"description": "Streamline your customer experience with an all-in-one community engagement platform. Say goodbye to the hassle of multiple tools.",
"url": "https://bettermode.com",
"icon": "", // This field is optional
}
]
}