how do I retrieve data from our company community TKB and display them within our company website?
I'm trying to create a search widget in our company website. It will allow users to input a key word in the search box and then call an API to retrieve articles from our company community TKB and display them in the widget within our company website without having people go to our community website and search from there. Ideally, we were thinking of using an ajax call and the response should have: title, brief content, and its URL in company community TKB. It would be better if the response is in JSON format.
I tried the API like this:
mycompanycommunity.com/t5/forums/searchpage/tab/message?allow_punctuation=true&filter=lab…:mycompanyname-tkb&q=...
But the API redirected me to the company community instead. What I need is to get data ONLY from the TKB and handle the response in our company website.
Does anyone of you have some experience with something similar? Which REST API should I use? This is very important to company success and a nifty feature to have.
You might want to add this to your search query so that it returns all message elements as part of the response:
&restapi.response_style=view&restapi.format_detail=full_list_element
The excerpt you highlighted is something created dynamically by cutting the body of the message in our UI. So in order to create your own excerpt, you could do the same by taking the message <body> content and cut only one part of it at a predefined number of characters.