Skip to content
RSFlowHub

How to Connect a Website Chatbot to Your Own API for Live Answers

How to Connect a Website Chatbot to Your Own API for Live Answers

Quick Answer

To connect a website chatbot to your own API, build one https endpoint that answers in the chatbot's JSON format and paste its URL into the chatbot's settings. In RSFlowHub the server recognises the visitor's question, calls your endpoint with a signed request, checks the answer and shows it as cards. Your URL and secret never reach the browser, private lookups need a phone or email, and the connection only reads. A developer can build the first action in an afternoon.

A chatbot trained on your documents can explain your fees, but it cannot tell a parent whether a batch still has seats, or a patient which slots are free tomorrow. That data lives in your own software. If your business runs on a custom system instead of Shopify or WooCommerce, the way to answer those questions is a small API endpoint. This guide is for the owner who wants to understand the idea and the developer who will build it.

How it works

  1. A visitor types "red shoes under 2000?" into the chat on your website.
  2. Our server matches the question to an action you switched on, and reads the details from the message: the words and the budget.
  3. It calls your endpoint with those details, signed with your secret.
  4. It checks your answer against the format, removes anything unknown and removes any HTML.
  5. The visitor sees cards in the chat, usually in about a second if your API is fast.

If a required detail is missing, the chatbot asks for it in plain words, such as "Please share your order number", and then calls your API.

What you can connect, by industry

There are ready-made actions for 12 kinds of business. You build only the ones you switch on, and you can add your own.

Business Some of the answers
Online store Search products, Categories, Offers and coupons, Delivery to a pincode
Restaurant or cafe Search the menu, Menu categories, Today's specials, Open now
Coaching institute Search courses, Fee details, Batches, Demo class slots
Clinic or hospital Find a doctor, Doctor availability, Service charges, Appointment status
School or college Class fees, Admission details, Events and holidays, Admission status
Real estate Search properties, Site visit slots, Booking status
Salon or spa Services and rates, Offers, Free slots, Appointment status
Gym or fitness studio Membership plans, Class schedule, Free trial slots, Membership status
CA or tax consultant Services and charges, Document checklist, Consultation slots, Filing status
Travel agency Search packages, Departure dates, Booking status
Jewellery shop Gold and silver rates, Search designs, Order status, Repair status
Car or bike dealer Search vehicles, On-road price, EMI estimate, Test drive slots
On Shopify or WooCommerce?
You do not need an endpoint for products and orders. Connect with read-only keys instead: see the WooCommerce guide or the Shopify guide.

What your developer builds

One URL handles every action, and the action name arrives in ?action=. The work is small:

  1. In Dashboard → your chatbot → Live data, paste the https URL and choose your business type. Saving creates your secret, shown once.
  2. Start from the PHP or Node.js starter code, which checks the signature and answers the verify call.
  3. Press Verify endpoint. This proves you control the URL.
  4. Add one block per action. Each action's page shows the format it expects, and Run test shows the card a visitor would see, with any problem named by its field.
  5. Switch on the actions you built. Private ones also need the chatbot's allowed domains set.

The request and the answer

A public action is a signed GET with the details in the URL. A private action, such as order status, is a signed POST with the details in the JSON body, because a phone number in a URL ends up in access logs.

what we send HTTP
GET /rsflowhub?action=product_search&q=red+shoes&price_max=2000&limit=5 HTTP/1.1
Host: shop.example.com
X-RSFlowHub-Action: product_search
X-RSFlowHub-Timestamp: 1793923200
X-RSFlowHub-Signature: sha256=<hex hmac>

You answer with HTTP 200 and JSON. Only rsflowhub and status are always required, and fields we do not know are ignored and never reach a visitor.

what you answer JSON
{
    "rsflowhub": "1.0",
    "status": "ok",
    "type": "items",
    "data": {
        "items": [
            {
                "id": "sku-221",
                "title": "Red Running Shoes",
                "price": {
                    "amount": 1899,
                    "currency": "INR",
                    "compare_at": 2499
                },
                "availability": {
                    "state": "low_stock",
                    "label": "Only 3 left"
                },
                "url": "https://shop.example.com/p/red-running-shoes"
            }
        ]
    },
    "meta": {
        "next_cursor": "p2",
        "cache_seconds": 120
    }
}

There are five card types: a list of items, one item in full, where something stands, what is free and when, and a small table of facts. meta.next_cursor adds a Show more button. The docs list every status and field.

Security you should insist on

Connecting a chatbot to your systems is safe only if the connection is built carefully. Whichever product you use, ask about these points. This is how RSFlowHub handles them:

  • Signed requests: every call carries an HMAC-SHA256 signature made with your secret and a timestamp, so your API can refuse anything else.
  • A second proof for private data: a reference number alone is never enough. The visitor also gives a phone or email, your API checks both together, and a wrong phone and an unknown reference must get the same answer.
  • The answer is checked: it is rebuilt from known fields only, with HTML removed, and only https links. Card, Aadhaar and PAN numbers in private answers are masked.
  • The AI never sees private answers: a private answer goes to the visitor as a card and is not added to the AI's conversation.
  • Nothing about the visitor is forwarded: no IP address, cookies or browser details reach your API.
  • Your URL is guarded: https on port 443 and public addresses only, with no redirects, so the connection cannot be pointed at an internal server.
  • It only reads: the chatbot does not book, cancel or change anything.

What happens when your API is down

A slow answer (over 4 seconds), a 500 error, a redirect or broken JSON counts as a failure. It is logged for you and never shown to the visitor. After that:

  • A public question goes on to the normal chatbot, which is told not to state prices, stock or order status.
  • A private question gets the fallback text you wrote, such as your support number. It never goes to the AI.
  • If failures keep coming, calls pause for a while so your API can recover, and you get an email at most once an hour.

Why not let the AI call your API directly?

A common way to build this is function calling, where an AI model decides which API to call and writes the reply from the raw data. It is flexible, and for an internal tool it can be a good fit. For a public chat window it has real downsides: every lookup costs an AI call, the model sees your customers' data, and a clever message can try to steer which function runs with which values.

Here, the action and its details are read with fixed patterns and checked rules wherever possible, your answer is displayed as cards rather than rewritten, and private answers stay away from the model. The trade-off is that it answers the actions you set up, not any question about your data.

What it costs

Live data is available on the Starter plan and above. Each answer uses 1 credit, while a failed call or a private lookup that found nothing costs nothing. See the pricing page for current prices in rupees.

Connect Your Own System

One signed endpoint, ready-made actions for your industry and a tester that shows the exact card a visitor will see.

Read the Live Data Docs →

Key Takeaways

  • A knowledge base explains things; live answers such as seats, slots and orders need your own system.
  • One https endpoint can answer every action, with the action name in the URL.
  • Sign every request, and refuse anything without a valid signature.
  • Private lookups need a reference and a phone or email, checked together.
  • Plan for failure: the visitor should get a safe answer when your API is down.

Start with How to Add an AI Chatbot to Your Website, then read about lead capture and support tickets. See your industry on the AI chatbot by industry pages.

Frequently Asked Questions

Build one https endpoint that answers in the chatbot's JSON format, paste its URL in your chatbot's Live data tab, press Verify and switch on the actions you built. Our server calls your endpoint when a visitor asks a matching question and shows the answer as cards.

Building an endpoint needs a developer. If your store runs on Shopify or WooCommerce you do not need one: connect with read-only keys instead. For everything else, a developer can start from the PHP or Node.js starter code.

No. Calls come from our server, so your URL and secret never reach the visitor's browser. Each call is signed with your secret and a timestamp, and your code should refuse anything without a valid signature.

A reference number alone is never enough. The visitor also gives a phone or email, your API checks both together, and it must answer the same way for a wrong phone and an unknown reference. Private answers are not cached and do not go to the AI model.

No. The connection only reads. It can show free slots, for example, but it cannot book one. To take a booking, the card can link to your own booking page.

It counts as a failure, is logged for you and is never shown to the visitor. A public question goes on to the normal chatbot, which is told not to state live facts. A private question gets the fallback text you wrote.

Reviews & Discussion (0)

0

Based on 0 ratings

5 ★
0%
4 ★
0%
3 ★
0%
2 ★
0%
1 ★
0%
Write a Review or Comment
No rating selected
No comments yet

Be the first to share your thoughts on this article!

Unified AI Access ⚡

One API Key. Infinite Possibilities.

Get access to OpenAI, Anthropic, Gemini, and more through a single, secure gateway. Start building in minutes with zero setup friction.

RSFlowHub

Sign in to continue

You'll come straight back to this page.

Forgot password?

New to RSFlowHub? Create a free account