GET
/
v2
/
bots
/
requests
/
public
import requests

url = "https://api-prod.usefini.com/v2/bots/requests/public"
token = "your_api_key"  # Replace with your actual API key
headers = {"Authorization": f"Bearer {token}"}

params = {
    "startEpoch": 1633046400000,  # Optional
    "endEpoch": 1635638400000,  # Optional
    "limit": 50,  # Optional
    "direction": "",  # Optional (e.g., 'next' or 'previous')
    "cursor": "your_cursor_value",  # Optional
    "source": "zendesk",  # Optional
    "category": "support",  # Optional
    "feedbackType": "",  # Optional ('thumbs_up', 'thumbs_down', 'no_feedback')
    "escalation": True,  # Optional
    "hasLinks": False,  # Optional
    "userId": "",  # Optional
    "ticketId": "ticket456",  # Optional
    "question": "Example question?"  # Optional
}

response = requests.get(url, params=params, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print(f"Failed to fetch data: {response.status_code}")
{
    "conversations": [
        {
            "id": "a35607bc-8008-44fd-9991-1d7c2c5c3f22",
            "externalId": null,
            "source": "widget",
            "channel": null,
            "escalation": false,
            "hasLinks": true,
            "feedbackType": null,
            "expectingUserFollowup": false,
            "url": null,
            "categories": [
                "fini-other"
            ],
            "createdAt": 1740407169191,
            "updatedAt": 1740407178879,
            "botRequests": [
                {
                    "question": "Hello",
                    "answer": "Hello, how can I help you?",
                    "categories": [
                        "fini-other"
                    ],
                    "escalation": false,
                    "reasoning": null,
                    "feedbackType": null,
                    "expectingUserFollowup": false,
                    "createdAt": 1740407178963,
                    "basedOn": []
                },
            ]
        },
    ],
    "hasMore": false
}

Query

source
string
default:"none"
required

Allows you to fetch chat history for a particular source, or all sources. Valid values are “all”,“zendesk”,“slack”,“discord”,“widget”,“intercom”,“ui”,“api”

startEpoch
number
default:"none"

Epoch timestamp in milliseconds for the start date of history

endEpoch
number
default:"none"

Epoch timestamp in milliseconds for the end date of history

limit
number
default:"50"

The number of records to fetch per request

direction
string
default:"none"

Direction for pagination (e.g., “next” or “previous”)

cursor
string
default:"none"

Cursor for pagination

category
string
default:"none"

Filter by category

feedbackType
string
default:"none"

Feedback type filter (e.g., “thumbs_up”, “thumbs_down”, “no_feedback”)

escalation
boolean
default:"false"

Filter conversations based on escalation status

Filter conversations that contain knowledge

ticketId
string
default:"none"

Filter by ticket ID (this is from your ticketing system)

question
string
default:"none"

Filter by question text

Response

conversations
array

A list of conversations containing chat history.

hasMore
boolean

Indicates if there are more conversations to fetch

import requests

url = "https://api-prod.usefini.com/v2/bots/requests/public"
token = "your_api_key"  # Replace with your actual API key
headers = {"Authorization": f"Bearer {token}"}

params = {
    "startEpoch": 1633046400000,  # Optional
    "endEpoch": 1635638400000,  # Optional
    "limit": 50,  # Optional
    "direction": "",  # Optional (e.g., 'next' or 'previous')
    "cursor": "your_cursor_value",  # Optional
    "source": "zendesk",  # Optional
    "category": "support",  # Optional
    "feedbackType": "",  # Optional ('thumbs_up', 'thumbs_down', 'no_feedback')
    "escalation": True,  # Optional
    "hasLinks": False,  # Optional
    "userId": "",  # Optional
    "ticketId": "ticket456",  # Optional
    "question": "Example question?"  # Optional
}

response = requests.get(url, params=params, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print(f"Failed to fetch data: {response.status_code}")
{
    "conversations": [
        {
            "id": "a35607bc-8008-44fd-9991-1d7c2c5c3f22",
            "externalId": null,
            "source": "widget",
            "channel": null,
            "escalation": false,
            "hasLinks": true,
            "feedbackType": null,
            "expectingUserFollowup": false,
            "url": null,
            "categories": [
                "fini-other"
            ],
            "createdAt": 1740407169191,
            "updatedAt": 1740407178879,
            "botRequests": [
                {
                    "question": "Hello",
                    "answer": "Hello, how can I help you?",
                    "categories": [
                        "fini-other"
                    ],
                    "escalation": false,
                    "reasoning": null,
                    "feedbackType": null,
                    "expectingUserFollowup": false,
                    "createdAt": 1740407178963,
                    "basedOn": []
                },
            ]
        },
    ],
    "hasMore": false
}