API DOCUMENTATION

Learn how to use RafikiAI from start to finish. Step-by-step guide to create, customize, and deploy your AI chat widget.

1

Create Your Account

Get started by creating your free RafikiAI account.

  1. Go to https://rafikiaicompany.com/register.html
  2. Fill in your details:
    • Full Name
    • Email Address
    • Password (minimum 8 characters)
  3. Click "Sign Up" to create your account
  4. Check your email for verification (if required)
  5. Log in to your dashboard
Note: No credit card required. Your account is completely free forever!
2

Create Your First AI Assistant

Create an AI assistant that will handle customer inquiries on your website.

  1. After logging in, navigate to "AI Assistants" in the dashboard
  2. Click the "Create New AI Assistant" button
  3. Fill in the required information:
    • Name: Give your AI assistant a name (e.g., "Customer Support Bot")
    • Description: Describe what your AI assistant does
    • Welcome Message: The first message visitors see when they open the chat
    • Default Response: Fallback message if the AI doesn't know the answer
  4. Configure chat widget settings:
    • Chat Widget Subtitle: Text shown below the widget title
    • Chat Widget Theme Color: Choose a color that matches your website (click the color picker)
    • Widget Position: Choose where the widget appears (bottom-right, bottom-left, top-right, or top-left)
  5. (Optional) Upload a logo for your chat widget
  6. Click "Create AI Assistant"
Tip: You can create multiple AI assistants for different purposes or departments!
3

Create Your Knowledge Base (Optional but Recommended)

Create a knowledge base with your business information to train your AI assistant.

  1. Go to "Knowledge Bases" in the dashboard
  2. Click "Create New Knowledge Base"
  3. Give it a name (e.g., "Company Information" or "Product FAQs")
  4. Upload your documents:
    • Supported formats: PDF, TXT, DOCX, MD
    • You can upload multiple files
    • Files can contain FAQs, product information, policies, company details, etc.
  5. Click "Create Knowledge Base"
  6. Wait for processing to complete (usually takes a few seconds)
Best Practice: Upload comprehensive information about your products, services, policies, and FAQs for the best AI responses.
3.5

Connect Knowledge Base to Your AI Assistant

Important: After creating your knowledge base, you need to connect it to your AI assistant so it can use that information.

Method 1: Connect When Creating AI Assistant
  1. When creating a new AI assistant (Step 2), look for the "Knowledge Bases" dropdown field
  2. Click the dropdown and select the knowledge base you created
  3. Complete the rest of the AI assistant creation form
  4. Click "Create AI Assistant"
  5. The knowledge base will be automatically connected!
Method 2: Connect to Existing AI Assistant
  1. Go to "AI Assistants" in the dashboard
  2. Find the AI assistant you want to connect the knowledge base to
  3. Click the "Edit" button (pencil icon) next to your AI assistant
  4. In the edit modal, find the "Knowledge Bases" dropdown field
  5. Click the dropdown and select your knowledge base from the list
  6. Click "Update AI Assistant" to save
  7. The knowledge base is now connected and your AI will use it for responses!
Success! Once connected, your AI assistant will automatically use the information from your knowledge base to answer customer questions accurately.
Note: You can connect one knowledge base to multiple AI assistants, or create separate knowledge bases for different AI assistants.
4

Get Your Embed Code

Copy the embed code to add the chat widget to your website.

  1. Go back to "AI Assistants" in the dashboard
  2. Find your AI assistant in the list
  3. Click the "Embed" button (or icon) next to your AI assistant
  4. A modal will open showing your embed code
  5. Click the "Copy Code" button
  6. The code will be copied to your clipboard
Important: You must add this code to a SHARED template (header/footer) that loads on every page, NOT to individual pages!
5

Add Embed Code to Your Website

Paste the embed code into your website's shared template file.

For WordPress:
  1. Go to Appearance → Theme Editor
  2. Select "Footer" (footer.php)
  3. Find the closing </body> tag
  4. Paste your embed code just before </body>
  5. Click "Update File"
For HTML Websites:
  1. Open your main HTML file (usually index.html)
  2. Find the closing </body> tag
  3. Paste your embed code just before </body>
  4. If you have a shared header/footer file, add it there instead
  5. Save the file and upload to your server
For Shopify:
  1. Go to Online Store → Themes
  2. Click "Actions" → "Edit code"
  3. Open "theme.liquid" (main layout file)
  4. Find the closing </body> tag
  5. Paste your embed code just before </body>
  6. Click "Save"
For Wix/Webflow:
  1. Go to your site settings
  2. Find "Custom Code" or "Footer Code" section
  3. Paste your embed code there
  4. Save and publish your site
Remember: Add the code to a shared template so it appears on ALL pages automatically!
6

Test Your Chat Widget

Verify that your chat widget is working correctly on your website.

  1. Visit your website in a web browser
  2. Look for the chat widget button (usually in the bottom-right corner)
  3. Click the chat widget to open it
  4. Verify that:
    • The widget opens correctly
    • Your logo appears (if uploaded)
    • The colors match your brand
    • The welcome message displays
  5. Send a test message
  6. Check that the AI responds appropriately
Success! If the widget appears and responds, you're all set!
7

Manage Conversations

View and manage all customer conversations from your dashboard.

  1. Go to "Conversations" in the dashboard
  2. Select an AI assistant from the dropdown to filter conversations
  3. View all conversations with:
    • Customer information
    • Message count
    • Status (Active/Closed)
    • Date started
  4. Click "View" to see the full conversation
  5. You can see all messages exchanged between the customer and AI
Tip: Conversations update in real-time using WebSocket, so you'll see new messages as they happen!
8

Customize & Optimize

Fine-tune your AI assistant for the best performance.

  1. Edit AI Assistant:
    • Go to "AI Assistants"
    • Click "Edit" on your AI assistant
    • Update settings, messages, colors, or logo
    • Changes reflect automatically on your website
  2. Add More Knowledge:
    • Upload additional documents to your knowledge base
    • Update existing documents
    • The AI will use the latest information
  3. Monitor Performance:
    • Check conversation analytics
    • Review common questions
    • Identify areas where the AI needs more training

Troubleshooting

Widget Not Appearing?
  • Make sure you added the code to a shared template, not individual pages
  • Check that the code is placed just before </body>
  • Clear your browser cache and refresh
  • Check browser console (F12) for any JavaScript errors
  • Verify the embed code was copied completely
AI Not Responding?
  • Check that your AI assistant is active in the dashboard
  • Verify your knowledge base is uploaded and processed
  • Test with a simple question first
  • Check the "Conversations" page to see if messages are being received
Need More Help?

Contact our support team at joshuaengineer1@gmail.com

Quick Reference

Dashboard Links
  • AI Assistants: Create and manage your AI assistants
  • Knowledge Bases: Upload and manage training documents
  • Conversations: View all customer conversations
  • Settings: Manage your account settings
Key Features
  • Unlimited AI assistants
  • Unlimited conversations
  • Customizable widget design
  • Multi-language support
  • Real-time updates
  • Analytics and insights