Skip to main content

Quickstart Guide

Get the WispHub API running locally in just a few steps. This guide will have you making your first API request in under 5 minutes.

Prerequisites

Before you begin, ensure you have:
  • Docker installed on your system
  • A WispHub Net API key
  • Basic familiarity with REST APIs

Step 1: Configure Environment Variables

Create a .env file in your project root with your WispHub credentials:
.env
WISPHUB_NET_KEY=your_api_key_here
WISPHUB_NET_HOST=https://api.wisphub.net
MAX_ACTIVE_TICKETS_PER_ZONE=3
Never commit your .env file to version control. Add it to your .gitignore file.

Step 2: Build the Docker Image

Clone the repository and build the Docker image:
git clone https://github.com/soporte-ainovapro/wisphub-api.git
cd wisphub-api
docker build -t wisphubapi:latest .
The build process will:
  • Use Python 3.12-slim base image
  • Install all dependencies from requirements.txt
  • Create a non-root user for security
  • Configure health checks

Step 3: Run the Container

Start the API server using Docker:
docker run -d \
  --name wisphub_api_server \
  -p 8000:8000 \
  --env-file .env \
  wisphubapi:latest
The API will be available at http://localhost:8000
The container runs Gunicorn with 4 Uvicorn workers by default, providing async request handling and automatic worker restart on failures.

Step 4: Verify Installation

Test the health check endpoint to confirm the API is running:
curl http://localhost:8000/health
Expected response:
{
  "success": true,
  "action": null,
  "message": null,
  "data": {
    "status": "ok",
    "service": "WispHub Local API"
  }
}

Step 5: Explore the API

Visit the interactive API documentation to explore all available endpoints:
http://localhost:8000/docs
The Swagger UI provides:
  • Complete endpoint documentation
  • Request/response schemas
  • Interactive API testing
  • Authentication configuration

Make Your First Request

Try retrieving all clients:
curl http://localhost:8000/api/v1/clients/
{
  "success": true,
  "action": "clients_listed",
  "message": null,
  "data": [
    {
      "service_id": 123,
      "name": "John Doe",
      "document": "1234567890",
      "phone": "3001234567",
      "address": "Calle Principal 123",
      "zone_id": 1,
      "internet_plan_name": "Plan Básico 10MB",
      "internet_plan_price": 35000.0,
      "status": "active"
    }
  ]
}

Next Steps

Now that you have the API running, explore these topics:

Architecture

Learn about the caching system and middleware design

API Reference

Explore all available endpoints and schemas

Authentication

Understand API key configuration and security

Deployment

Deploy to production with advanced Docker configurations

Common Issues

Change the host port mapping:
docker run -d --name wisphub_api_server -p 8001:8000 --env-file .env wisphubapi:latest
Access the API at http://localhost:8001
Check the logs:
docker logs wisphub_api_server
Common causes:
  • Missing or invalid environment variables
  • Port conflicts
  • Insufficient Docker resources
Verify your WISPHUB_NET_KEY in the .env file is correct and has the necessary permissions to access WispHub Net endpoints.

Development Mode

For local development with hot-reload, see the Local Development guide.

Build docs developers (and LLMs) love