Please read this page carefully and make sure that you have all your credentials and necessary assets available before you start. If you need help, contact Inbenta.
The purpose of the Knowledge API is to grant access to the contents stored in your Inbenta Knowledge instance. You can then use these contents in any user-generated application and track event data for usage analysis. You can find these reports in the instance's Dashboard.
This page describes how to set up the Knowledge API, and how to request and retrieve information.
All requests to the Knowledge API endpoints must be authenticated and authorized.
To obtain your credentials, see Finding your API credentials in the Help Center.
For a complete description of keys and authorization methods, see the Authorization section.
Your Secret must remain confidential. To prevent third parties from accessing your API, always perform this request in a server-side environment.Never expose your secret in client-side integrations. For more information, see the Authorization page.
You need a valid access token to use the Knowledge API. Follow the steps listed in the Authorization section to set up your page with your token and refresh it. Once you obtain the access token, you must append it to every request inside the Authorization header, with the format Bearer <your_access_token>.
The base URLs of the Knowledge API are dependent on the instance, so that Inbenta can offer worldwide service and allow service auto-escalation. This base URL may change over time. Do not store or cache it persistently. Instead, get it every time you obtain a new valid access token.
To get the current API URL for your instance, get the apis
parameter from the same response that gave you the access token. Extract the URL corresponding to the instance product:
{ "accessToken": "******************", "expiration": 1573563837, "expires_in": 1200, "apis": { ... "knowledge": "https://endpoint.inbenta.example/km", ... } }
Do not perform this request after each API call! You would quickly exceed your rate limits.
Once you have the appropriate API URL for your implementation, you must specify the version of the API.
You specify the version at the end of the URL with v + {version}
.
Examples:
The URLs for the current latest version of each Knowledge API look like this:
"https://endpoint.inbenta.example/prod/km/v1"
For a complete description of keys and authorization methods, see the Authorization section.
You need a valid access token to use the Knowledge API. Follow the steps listed in the Authorization section to set up your page with your token and refresh it.
Your Secret must remain confidential. To prevent third parties from accessing your API, always perform this request in a server-side environment. Never expose your secret in client-side integrations.
Once authorized, start the session to relate all events performed by a user during their interaction with your platform. To start the session, you will need a session token that can be generated using the POST /tracking/session endpoint.
For more information, see the Tracking Events section.
Now you can retrieve information from the Knowledge Base.
Example: Obtain results from a user question using the POST /search endpoint. This allows you to make a search in the content database. This endpoint requires:
For more information about POST /search and other endpoints, see the API routes section.