Create a Custom Integration

Connect any external API to Bothive so your bots can use it. This guide is for developers familiar with APIs.

Intermediate20 minutesDevelopers

Developer Guide

This guide assumes familiarity with REST APIs, JSON, and authentication methods. If you're new to APIs, start with the Study Buddy guide instead.

1

Plan Your Integration

Before building, identify: • What API do you want to connect? • What actions should bots be able to perform? • What authentication does the API require?

2

Navigate to Integration Builder

Go to the Integrations page and click 'Create Integration' to start building your custom connection.

3

Configure the API Connection

Enter your API details including the base URL, authentication method, and available endpoints. Here's an example configuration:

API Configuration (JSON)
{
  "name": "Weather API",
  "baseUrl": "https://api.openweathermap.org/data/2.5",
  "auth": {
    "type": "apiKey",
    "keyName": "appid",
    "location": "query"
  },
  "endpoints": [
    {
      "name": "getCurrentWeather",
      "method": "GET",
      "path": "/weather",
      "params": ["q", "units"]
    }
  ]
}
4

Map Actions to Tools

Each API endpoint becomes a tool that bots can use. Define: • Tool name (e.g., 'getCurrentWeather') • Required parameters • Response mapping

5

Test the Integration

Use the test panel to make sample API calls and verify the integration works correctly before submitting.

6

Use in Your Bots

Once approved, you can use the integration in your HiveLang code like this:

Using Integration in HiveLang
bot WeatherBot
  description "Gets weather information for any city"
  
  on input when input.message contains "weather"
    # Extract city from message
    call agent.analyze with {
      data: input.message,
      context: "Extract the city name from this weather query"
    } as cityAnalysis
    
    # Call the custom integration
    call integration.weather_api.getCurrentWeather with {
      q: cityAnalysis.city,
      units: "metric"
    } as weather
    
    say "🌤 Weather in " + cityAnalysis.city + ": "
    say "Temperature: " + weather.main.temp + "°C"
    say "Conditions: " + weather.weather[0].description
  end
end
7

Submit for Approval

All integrations are reviewed before becoming available to other users. This ensures security and quality.

Share Your Integration!

Once approved, other developers can install and use your integration in their bots.

Create Integration