API
ChatBot API Integration
Welcome to the Nisa Knowledge API, your gateway to a rich, customizable ChatGPT experience tailored to meet your business requirements. Whether you're building a customer service bot, a virtual assistant, or a suite of AI tools to augment organizational productivity and decision-making, our API simplifies the integration process.
Getting Started
Before proceeding, make sure you have registered on our platform to generate your unique API key. This is a crucial step towards unlocking a custom ChatGPT experience designed for your needs.
Endpoint
Authentication
Authenticate your requests by including your API key in the header of each request.
Header:
Replace YOUR_API_KEY
with the API key you generated in the platform.
Making a Request
Initiate a POST
request to the endpoint to interact with the chatbot. Your request body should include the content of your inquiry along with optional parameters like source
, verbose
, and stream
to tailor the request to your specifications.
Parameters:
message (required): The inquiry or message you wish to relay to the chatbot.
source (optional): To specify the source of information. The default value is 'ALL'.
stream (optional): A boolean flag to initiate a streaming response. The default value is false.
Example Request Body:
Response
Upon making a request, you will receive a JSON object containing the chatbot's reply, curated to provide precise and relevant answers in line with your organization's context. If the stream
parameter is set to true, the response will be streamed back to the client.
Example Response:
Example Streamed Response:
Stream Feature
When the stream
parameter is set to true in the request body, the response will be streamed to the client. This is particularly useful for handling long-running queries or processing large amounts of data. The response object will contain a done
flag indicating whether the streaming is complete, along with the message and sources of information used to generate the response.
Error Handling
In the event of an error, the API will respond with an appropriate status code along with a message describing the error.
Example Error Response:
Conclusion
Voila! Integrating the nisa Knowledge API into your applications is a straightforward process. By doing so, you unlock a tailored ChatGPT experience that can significantly boost productivity and enhance decision-making across your team. Ensure to handle the responses effectively and monitor your usage to avoid any disruptions.
Last updated