api-route

Create Express API routes and controllers for Bot Framework backends.

1|Updated Aug 22, 2025
One-click install
npx skills add https://github.com/interserver/teams-chat-bot --skill api-route-interserver
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-route
Source: https://github.com/interserver/teams-chat-bot/tree/main/.claude/skills/api-route
Command: npx skills add https://github.com/interserver/teams-chat-bot --skill api-route-interserver

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines adding new Express API endpoints that integrate safely with the Bot Framework adapter, preventing common production issues like transient failure cascades and silent authorization errors.

Core Features & Use Cases

  • Deterministic route scaffolding: Creates a controller under server/api/ that follows the established bot patterns, including adapter setup where applicable.
  • Production-grade resiliency: Enforces TRANSIENT_RE/AUTH_ERROR_RE, adapter.onTurnError, and retry logic to reduce intermittent network and auth failures.
  • Bot-safety guardrails: Ensures you do not override reserved bot message endpoints like POST /api/messages or POST /api/message.
  • Configuration hygiene: Requires MicrosoftAppId and MicrosoftAppPassword to come from environment variables instead of being hardcoded.

Quick Start

In your project, create a new controller in server/api/, register the route in server/api/index.js, and then test it with your local dev server and curl to confirm it returns JSON successfully.

Frequently Asked Questions about api-route

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new Express API route to a Microsoft Teams bot?

To add an Express API route to a MS Teams bot, create a controller module under server/api/, register it in server/api/index.js, and integrate the Bot Framework adapter for proper turn interaction.

How do I handle transient errors and retry logic in Express bot APIs?

Handle transient errors in Express bot APIs by applying the predefined TRANSIENT_RE regex and runWithRetry/sleep functions, ensuring intermittent network failures are caught and retried safely.

Can I add a webhook endpoint without breaking the Bot Framework message pipeline?

Yes, you can add webhook endpoints safely. The scaffolding process includes bot-safety guardrails that prevent overriding reserved Bot Framework message endpoints like POST /api/messages.

Why do my MicrosoftAppId and MicrosoftAppPassword cause silent authorization errors?

Silent authorization errors often occur when credentials are hardcoded. You must load MicrosoftAppId and MicrosoftAppPassword strictly from environment variables to prevent auth failures.

What is the best way to create auxiliary JSON APIs for a Bot Framework backend?

The best way to create auxiliary JSON APIs is to follow deterministic route scaffolding that enforces adapter.onTurnError handling and configuration hygiene for production-grade resiliency.