Skip to content

Add Knowledge Base API module for FreeScout with JavaScript and Python clients#1

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/add-knowledge-base-api-module
Draft

Add Knowledge Base API module for FreeScout with JavaScript and Python clients#1
Copilot wants to merge 7 commits intomainfrom
copilot/add-knowledge-base-api-module

Conversation

Copy link

Copilot AI commented Oct 30, 2025

Implements a FreeScout module that exposes the Knowledge Base via REST API for consumption by JavaScript applications and backend services.

FreeScout Module (Modules/KnowledgeBaseAPI/)

Laravel module with 11 REST endpoints:

  • Public endpoints (no auth): /api/kb/public/* - categories, articles, search
  • Protected endpoints (API key): /api/kb/* - full access with authentication
  • Hierarchical categories, pagination, full-text search, view tracking
  • SQL injection prevention via parameterized queries, XSS-safe responses

JavaScript Client (frontend/)

const client = new FreeScoutKBClient('https://your-freescout.com');
const articles = await client.search('password reset');

// Or use the complete widget
new KnowledgeBaseWidget('container-id', 'https://your-freescout.com');
  • FreeScoutKBClient - API wrapper with async methods
  • KnowledgeBaseWidget - Full UI component with search and navigation
  • HTML-escaped output prevents XSS

Python Client (backend/GlobalDeskClient.py)

client = FreeScoutClient()
categories = client.list_kb_categories(public=True)
articles = client.search_kb_articles("help", public=True)

Extended existing client with KB methods, maintains backward compatibility.

Documentation

  • INSTALLATION.md - Setup with troubleshooting
  • API_REFERENCE.md - Complete endpoint documentation
  • QUICKSTART.md - 5-minute integration guide
  • ARCHITECTURE.md - System design and data flow

Security

Fixed 2 XSS vulnerabilities identified by CodeQL (search query display, error messages). All user-controlled content now properly escaped. SQL injection prevented via parameterized queries.

Original prompt

I'd like to create a custom module for FreeScout that exposes the knowledge base with an API to then be read by a javascript function


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 6 commits October 30, 2025 15:00
…Python clients

Co-authored-by: gabeparra <29493146+gabeparra@users.noreply.github.com>
Co-authored-by: gabeparra <29493146+gabeparra@users.noreply.github.com>
Co-authored-by: gabeparra <29493146+gabeparra@users.noreply.github.com>
Co-authored-by: gabeparra <29493146+gabeparra@users.noreply.github.com>
Co-authored-by: gabeparra <29493146+gabeparra@users.noreply.github.com>
Co-authored-by: gabeparra <29493146+gabeparra@users.noreply.github.com>
Copilot AI changed the title [WIP] Add custom API module for knowledge base in FreeScout Add Knowledge Base API module for FreeScout with JavaScript and Python clients Oct 30, 2025
Copilot AI requested a review from gabeparra October 30, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants