Back

Landbot API Essential Guide

Aug 16, 20246 minute read

What type of API does Landbot provide?

REST (Representational State Transfer) APIs:

  • Based on HTTP protocol
  • Format-agnostic, can use XML, JSON, HTML, etc.
  • Lightweight and flexible
  • Easy to discover and test
  • Stateless and scalable
  • Can be developed in various programming languages

SOAP (Simple Object Access Protocol) APIs:

  • XML-based messaging protocol
  • More rigid structure compared to REST
  • Often used in enterprise environments
  • Provides built-in error handling and security features

GraphQL APIs:

  • Query language for APIs
  • Allows clients to request specific data
  • Provides a flexible and efficient way to fetch data
  • Reduces over-fetching and under-fetching of data
  • Offers strong typing and detailed error messages

gRPC (gRPC Remote Procedure Call) APIs:

  • High-performance RPC framework
  • Uses Protocol Buffers for data serialization
  • Designed for efficiency and scalability
  • Good for scenarios with large volumes of data or high concurrency

Does the Landbot API have webhooks?

Webhook Support

Yes, the official Landbot API does support webhooks, which they call "MessageHooks".

Types of Events

MessageHooks allow you to be notified of messages and events occurring in your bot. Specifically, you can subscribe to the following types of events:

  1. By Type:

    • Messages
    • Events
  2. By Sender:

    • Bot
    • User
    • Agent
  3. By Event Action:

    • The search results don't provide specific event actions, but they mention that events related to conversation assignment can be tracked.

Key Points

  • MessageHooks send HTTP POST requests to a designated endpoint whenever a message or specific event is triggered in the bot.
  • The payload of these requests contains a range of information that can be useful for automating processes or creating custom integrations.
  • MessageHooks are particularly useful for:
    • Integrating Landbot with third-party helpdesk software
    • Creating transcriptions
    • Building custom analytics dashboards
    • Implementing machine learning

Setting Up MessageHooks

To set up a MessageHook (Landbot webhook), you need to:

  1. Create a bot with a unique name
  2. Specify the Hook URL (the endpoint where you want to receive POST requests)
  3. Select the bot/channel you want to track
  4. Optionally, add a token for extra security

Code Example

While the search results don't provide a specific code example for implementing webhooks, they mention that you can find more information about the webhook requests format in the Landbot API documentation:

https://dev.landbot.io/chat/index.html#api-Webhooks-PostYour_webhook_url

Best Practices

  • Use Postman or a similar API testing tool to simplify the process of setting up and testing webhook integrations.
  • When integrating with external services (like CRMs), refer to their API documentation to understand the required parameters and data format.
  • Always test your webhook implementation thoroughly before deploying it in a production environment.

In conclusion, the Landbot API offers robust webhook support through their MessageHooks feature, allowing developers to create powerful integrations and automate various processes based on bot events and messages.

Rate Limits and other limitations

Unfortunately, I couldn't find any specific information about the API Rate Limits for the Landbot API in the provided search results. The search results don't contain any details about API rate limits or usage restrictions.

Here are some key points to consider:

  1. API rate limits are common for most web services to prevent abuse and ensure fair usage.

  2. Rate limits typically restrict the number of API calls a user or application can make within a certain time period (e.g., per second, minute, or hour).

  3. Without specific information, it's best to assume some form of rate limiting exists and to design your application accordingly.

To get accurate information about Landbot's API rate limits, I would recommend:

  1. Checking Landbot's official API documentation, if available.

  2. Contacting Landbot's support team directly for the most up-to-date information.

  3. Looking for any error responses related to rate limiting when making API calls, which might provide insights into the actual limits.

  4. Reviewing your service agreement or terms of use, which might mention API usage restrictions.

When working with any API, it's a best practice to implement proper error handling and backoff strategies to deal with potential rate limiting, even if the exact limits are not known.

Latest API Version

Based on the search results provided, I do not have enough information to determine the most recent version of the Landbot API. The search results do not contain any specific version numbers or release dates for the Landbot API.

Here are the key points to consider:

  1. Landbot does offer an API and SDK for developers to integrate with their platform [2].

  2. They have a Platform API that allows developers to "Create, retrieve and update your Landbot account programatically" [2].

  3. There is also a Chat API to "Add a conversational experience to your applications right away" [2].

  4. Landbot provides API documentation and SDK documentation for developers [2].

  5. The company has made updates to their bot builder interface over time, with version 3.0 being mentioned in one of the search results [5]. However, this refers to the bot builder, not necessarily the API version.

Without more specific information about API version numbers or release dates, I cannot definitively state what the most recent version of the Landbot API is. To get the most up-to-date information, I would recommend checking Landbot's official API documentation or contacting their developer support directly.

How to get a Landbot developer account and API Keys?

To get a developer account for Landbot and create an API integration, you can follow these steps:

  1. Sign up for a Landbot account:

    • Go to the Landbot website (https://landbot.io/) and create an account if you don't already have one.
  2. Access your API token:

    • Once logged in, go to your account settings at https://app.landbot.io/gui/settings/account
    • Look for the API token section, where you'll find your unique API token.
  3. Create an API Chat bot:

    • From the main Dashboard, click "Build a Chatbot" and select "Landbot ApiChatbot"
    • Set a name for your bot and save it.
  4. Set up the Hook URL:

    • In the Channels section, you'll need to set up the Hook URL where events and messages will be posted
    • Introduce a Channel name (for your reference)
    • Enter the Hook URL where you want to receive POST requests for messages and events.
  5. Link your API Chat bot:

    • In the "Linked Bot" tab, select the API chat bot you created in the Dashboard.
  6. Use the API:

    • You can now use the Landbot API to send messages, retrieve data, and manage your bot
    • Use your API token for authentication when making requests to the Landbot API.

What can you do with the Landbot API?

Based on the search results provided, here are the key data models you can interact with using the Landbot API:

Metrics

  • Number of users that started and completed conversations
  • Goal completion rates (if using goal blocks)
  • Ability to filter data by date range and timeframe
  • Visualization options for metrics data

Users

  • Details of every user that interacted with the bot
  • Variables saved during user interactions
  • Ability to add filters and show/hide specific variables

Flow Analytics

  • Visualization of the chatbot flow
  • Block-by-block conversion and drop-off ratios
  • Number of visitors that chose each path in the flow
  • Ability to export flow as PNG file

Conversation Data

  • Full conversation history and context
  • Ability to access updated conversation memory

Variables

  • Custom variables set during conversations
  • System variables provided by Landbot
  • Ability to extract and use variables in integrations

Webhooks

  • Make API calls to external services
  • Save responses as variables
  • Route responses based on status codes

Templates

  • Access to pre-built templates and flows

While not explicitly stated as data models, the API likely also allows interacting with:

  • Bot configurations and settings
  • Integration connections (e.g. to ChatGPT)
  • User authentication and access management

The API seems to provide comprehensive access to conversation data, analytics, and bot management capabilities. However, the exact data models and endpoints are not fully detailed in the provided search results.