AI Chatbot Hub
HomepageAPI docsDiscordLog inSign up
API docs
API docs
  • API usage guides
    • Getting an API key
    • Create a chatbot
    • Chat with chatbot
    • Uploading data sources
  • Chatbots
    • Chatbot properties
    • Create chatbot
    • Update chatbot
    • Fetch a chatbot
    • Fetch all chatbots
    • Delete chatbot
  • Agents
    • Agent properties
    • Create agent
    • Update agent
    • Fetch all agents
    • Delete agent
  • Chatbot sessions
    • Session properties
    • Create session
    • Fetch a session
    • Fetch all sessions
    • Delete session
  • Session messages
    • Message properties
    • Create message
    • Fetch all messages
    • Delete message
    • Delete multiple messages
  • Data sources
    • Source properties
    • Upload a file
    • Create QA source
    • Create URL source
    • Update source
    • Fetch list of sources
    • Retrain sources
    • Delete source
    • Delete multiple sources
  • Data source tags
    • Create source tag
    • Fetch all source tags
    • Update source tag
    • Delete source tag
Powered by GitBook
On this page
  • Prerequisites
  • API Endpoint
  • Request Body
  • Example Request
  1. API usage guides

Uploading data sources

How to upload data sources to your chatbot using the AI Chatbot Hub API

Prerequisites

Before you begin, ensure you have:

  • An API key to access the AI Chatbot Hub API.

  • A development environment or tool to make HTTP requests, such as Curl or a programming language like Python.

API Endpoint

The API endpoint for uploading data sources to your chatbot is: https://app.aichatbothub.com/api/v1/chatbot/{uuid}/data-source/url

Replace {uuid} with your chatbot’s unique identifier (UUID).

Request Body

To upload a data source, send a POST request to the API endpoint. The request body should include the URL of the data source you want to upload. Below is an example:

{
  "url": "https://example.com/data-source"
}

Request Body Details

  • url (string, required): The URL of the data source you wish to upload.

Example Request

Here’s an example command to upload a data source using the AI Chatbot Hub API. Replace <token> with your actual API key.

curl --location --request POST 'https://app.aichatbothub.com/api/v1/chatbot/{uuid}/data-source/url' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "url": "string"
}'
import requests

url = 'https://app.aichatbothub.com/api/v1/chatbot/{uuid}/data-source/url'
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <token>'
}

params = {
    'uuid': '<chatbot-uuid>'
}

data = {
    "url": "string",
}

response = requests.post(url, headers=headers, params=params, json=data)

if response.status_code == 200:
    print("Request successful!")
    print(response.json())
else:
    print("Request failed with status code:", response.status_code)
    print(response.text)
const axios = require('axios');

const url = 'https://app.aichatbothub.com/api/v1/chatbot/{uuid}/data-source/url';
const headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <token>'
};

const params = {
    uuid: '<chatbot-uuid>'
};

const data = {
    "url": "string",
};

axios.post(url, data, { headers, params })
    .then(response => {
        console.log('Request successful!');
        console.log(response.data);
    })
    .catch(error => {
        console.error('Request failed:', error);
    });

You’ve successfully learned how to upload data sources to your chatbot using the AI Chatbot Hub API. Now your chatbot can leverage the uploaded data for more specific and enriched interactions!

PreviousChat with chatbotNextChatbot properties

Last updated 6 months ago