Learn about the Flow REST API asynchronous request-response model.
The Flow REST API operates using an asynchronous model, which sets it apart from many traditional Natural Language Processing (NLP) APIs. In a typical synchronous operation, a request for information or a command sends a direct response immediately. However, with the Flow API, this process diverges significantly.
When you send a message request to the Flow API, the API triggers a different mechanism instead of returning a direct reply. It does not provide the information or confirmation right away. Instead, it sends a POST request to a designated webhook URL that you have configured in your settings. This webhook acts as an endpoint where your application listens for events or updates triggered by the Flow API.
This means that your system must be set up to receive and handle these POST requests. The API notifies your application of various events through asynchronous messages, such as user interactions, message deliveries, or other relevant activities. This model's advantages include the ability to handle multiple requests and responses without blocking the application, allowing for greater scalability and responsiveness.
In summary, using the Flow API requires a different approach to managing communication. Properly setting up the webhook is crucial to ensuring that your application receives and processes notifications as events occur.
The below images represent the request-response model.
The below images represent the request-response model.

Sending a message to Khoros Flow

Receiving replies from Khoros Flow
Instead, the API will respond by sending a POST request to your configured webhook url whenever an event takes place.
Need a synchronous response?
Refer to the Synchronous Responses Guide to understand an optional synchronous reply mode that is available for specific endpoints.