Prerequisites

Before you begin, ensure you have the following:

  1. A ChatFly account to obtain an access token.
  2. A development environment or a tool for making HTTP requests, such as Curl or a programming language like Python.

Uploading Data Sources

API Endpoint

The API endpoint for uploading data sources to your chatbot is:

https://backend.chatfly.co/api/scraping/url

Request Body

To upload a data source, send a POST request to the API endpoint with a JSON request body containing the URL of the data source. Here’s an example request body:

{
  "bot_id": "xxxx-xxxx-xxxx-xxxx",
  "scrape_url": "Your URL",
  "scrape_type": 2
}
  • bot_id (string): ID of your bot.
  • scrape_url (string): Link to the website URL where you want to scrape information.
  • scrape_type (int): The method by which you import the data source.

Example Request

Here are example commands for uploading data sources using the ChatFly API:

Replace token with your access token.

Get Data Sources

API Endpoint

The API endpoint for getting a list of URLs for your chatbot is:

https://backend.chatfly.co/api/scraping/url/{bot_id}.

Make sure to replace {bot_id} with the UUID of your bot.

Request Body

To get a list of URLs, send a GET request to the API endpoint with a params request. Here’s an example params request:

{
  "bot_id": "xxxx-xxxx-xxxx-xxxx"
}
  • bot_id (string): ID of your bot.

Example Request

Here are example commands for getting a list of URLs using the ChatFly API:

Replace token with your access token.

Response Body

The list of URLs is responded:

[
  {
    "knowledge_base_id": "xxxx-xxxx-xxxx-xxxx",
    "url": "Your URL",
    "num_token": 0
  },
  ...
]
  • knowledge_base_id (string): ID of the knowledge base.
  • url (string): Your website URL.
  • num_token (int): Number of words.