Skip to main content

Getting Started

Get an API Key

To start using Feedback Intelligence, you'll need an API key. You can get one by registering Feedback Intelligence Platform and creating a project.

Sending Data to FI

Once you get our API key you can start ingesting the data.

Using the Python SDK

The Python SDK is the easiest and most streamlined way to integrate your data with the FI Data Processor. It simplifies interaction with the API, allowing you to focus on your data instead of the request formatting or authentication handling. You can send context, feedback channels, and chat history directly without worrying about the underlying API details.

  • When to Use: If you’re working in Python and want a simple, ready-to-use solution for integrating your data with FI.
  • Benefits:
    • Simplifies API calls.
    • Automatically handles authentication.
    • Well-documented functions for sending data.

Example:

Check out the SDK Example.

JS SDK is available here.

Using Raw API Endpoints

For more flexibility or when using other programming languages, you can directly interact with FI’s API by using raw HTTP requests. This method allows you to fully customize your API requests and is ideal if you need more control or prefer not to use the SDK.

  • When to Use: If you're not using Python or need full control over API requests.
  • Benefits:
    • Greater flexibility in how you structure requests.
    • Compatible with any programming language that supports HTTP requests.
    • Direct access to API for advanced use cases.

Make sure to use the exact date format that is used in the examples below

Example:

Check out the API Example.

1. Adding Chats:

Endpoint:

  • POST /data/{project_id}/chat/add

Request Parameters:

  • project_id (int, path): The ID of the project to which the chat data should be added.

Payload:

{
"user_id": 1,
// Optional, the ID of the user who initiated the chat
"chat_id": 2,
// Required, the unique ID of the chat
"version": "1.0",
// Optional, the version of the chat
"messages": [
// Required, a list of messages in the chat
{
"role": "human",
// Required, the role of the message sender, either "human" or "ai"
"text": "Hello!",
// Required, the content of the message
"prompt": null,
// Optional, the prompt that generated the message
"date": "2020-01-20T13:00:00",
// Optional, the date the message was sent
"context": {
// Optional, context for the message, either with an ID or text
"id": 2,
"context": "Example context"
}
},
{
"role": "ai",
"text": "Hello how can I help you?",
"feedback": {
// Optional, feedback for the message
"thumbs_up": 1,
"rating": 4.5,
"message": "Great response!"
}
}
]
}

2. Adding Context: Endpoint: POST /data/{project_id}/context/add

Payload:

{
"id": 2,
// optional,
"context": "Example context"
}

3. Adding Feedback:

Endpoint: POST /data/{project_id}/feedback/add

Request Parameters:

  • project_id (int, path): The ID of the project to which the feedback should be added.

Payload:

{
"user_id": 1,
// Optional, the ID of the user who provided the feedback
"chat_id": 2,
// Optional, the ID of the chat associated with the feedback
"date": "2020-01-20T13:00:00",
// Optional, the date the feedback was given
"message": "Great service!",
// Required, the content of the feedback
"source": "email"
// Required, the source of the feedback
}