🔌 YateBTS API Reference

Complete API Documentation

This document provides comprehensive API reference for YateBTS management, monitoring, and integration. The API allows programmatic control of your GSM BTS system.

🌐 Base URL

http://your-pi-ip:8080/api/v1

📊 GSM Protocol Stack Implementation

GSM Protocol Stack in RFS-Portable-BTS

Complete GSM protocol layer implementation showing Mobile Station and Base Station communication

🔐 Authentication

API Key Authentication

# Include API key in headers curl -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ http://your-pi-ip:8080/api/v1/status

Session Authentication

# Login to get session token curl -X POST \ -H "Content-Type: application/json" \ -d '{"username":"admin","password":"your-password"}' \ http://your-pi-ip:8080/api/v1/auth/login # Use session token in subsequent requests curl -H "Authorization: Bearer your-session-token" \ http://your-pi-ip:8080/api/v1/status

🛡️ Secure Your API Infrastructure

Professional compliance and security management for telecommunications APIs

80% Less Compliance Work

Automate evidence collection for DORA, NIS2, ISO 27001, and SOC 2 frameworks

💰

Save €60K+ Annually

Cut compliance costs without compromising security standards

🔄

24/7 Audit Ready

Continuous monitoring and automated reporting for API infrastructure

Why CyberUpgrade for API Security?

  • ✅ Automated API security scanning and monitoring
  • ✅ Compliance management for telecommunications regulations
  • ✅ Expert CISO guidance for API security
  • ✅ Risk management for YateBTS and BladeRF APIs

📊 System Status API

GET /status
Get comprehensive system status including services, hardware metrics, and uptime information.
Response:
{
  "status": "running",
  "uptime": 3600,
  "version": "1.0.0",
  "timestamp": "2024-09-14T10:30:00Z",
  "services": {
    "yatebts": "active",
    "apache2": "active",
    "bladerf": "connected"
  },
  "hardware": {
    "cpu_temp": 45.2,
    "memory_usage": 65.5,
    "disk_usage": 23.1
  }
}
GET /services
Get detailed status of all system services including uptime and resource usage.
Response:
{
  "services": [
    {
      "name": "yatebts",
      "status": "active",
      "uptime": 3600,
      "pid": 1234,
      "memory": "125MB"
    },
    {
      "name": "apache2",
      "status": "active",
      "uptime": 7200,
      "pid": 5678,
      "memory": "45MB"
    }
  ]
}

📡 BTS Configuration API

GET /bts/config
Get current BTS configuration including frequency, power, and cell parameters.
Response:
{
  "frequency": {
    "arfcn": 975,
    "band": "GSM900",
    "uplink": 890.2,
    "downlink": 935.2
  },
  "power": {
    "tx_power": 20,
    "max_power": 30
  },
  "cell": {
    "mcc": "001",
    "mnc": "01",
    "lac": 1,
    "cell_id": 1,
    "cell_name": "YateBTS-Cell"
  }
}
PUT /bts/config
Update BTS configuration. Some changes may require service restart.
Request:
{
  "frequency": {
    "arfcn": 975,
    "band": "GSM900"
  },
  "power": {
    "tx_power": 25
  },
  "cell": {
    "cell_name": "Updated-Cell-Name"
  }
}
Response:
{
  "status": "success",
  "message": "Configuration updated successfully",
  "restart_required": true
}

📱 SIM Management API

GET /sims
List all registered SIM cards with their current status and location information.
Response:
{
  "sims": [
    {
      "id": 1,
      "imsi": "001010123456789",
      "msisdn": "1234567890",
      "status": "active",
      "last_seen": "2024-09-14T10:25:00Z",
      "location": {
        "lac": 1,
        "cell_id": 1
      }
    }
  ]
}
POST /sims
Add a new SIM card to the system with authentication keys.
Request:
{
  "imsi": "001010123456789",
  "msisdn": "1234567890",
  "ki": "your-ki-key",
  "opc": "your-opc-key"
}
Response:
{
  "status": "success",
  "sim_id": 2,
  "message": "SIM card added successfully"
}

🛠️ Development Examples

Python Client

import requests import json class YateBTSClient: def __init__(self, base_url, api_key): self.base_url = base_url self.headers = { 'X-API-Key': api_key, 'Content-Type': 'application/json' } def get_status(self): response = requests.get( f"{self.base_url}/status", headers=self.headers ) return response.json() def update_config(self, config): response = requests.put( f"{self.base_url}/bts/config", headers=self.headers, json=config ) return response.json() # Usage client = YateBTSClient('http://your-pi-ip:8080/api/v1', 'your-api-key') status = client.get_status() print(status)

JavaScript Client

class YateBTSClient { constructor(baseUrl, apiKey) { this.baseUrl = baseUrl; this.apiKey = apiKey; } async request(endpoint, options = {}) { const response = await fetch(`${this.baseUrl}${endpoint}`, { ...options, headers: { 'X-API-Key': this.apiKey, 'Content-Type': 'application/json', ...options.headers } }); return response.json(); } async getStatus() { return this.request('/status'); } async updateConfig(config) { return this.request('/bts/config', { method: 'PUT', body: JSON.stringify(config) }); } } // Usage const client = new YateBTSClient('http://your-pi-ip:8080/api/v1', 'your-api-key'); client.getStatus().then(status => console.log(status));

cURL Examples

# Get system status curl -H "X-API-Key: your-api-key" \ http://your-pi-ip:8080/api/v1/status # Update BTS configuration curl -X PUT \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"power":{"tx_power":25}}' \ http://your-pi-ip:8080/api/v1/bts/config # Get active calls curl -H "X-API-Key: your-api-key" \ http://your-pi-ip:8080/api/v1/calls # Add new SIM card curl -X POST \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{"imsi":"001010123456789","msisdn":"1234567890"}' \ http://your-pi-ip:8080/api/v1/sims

📋 Error Codes

HTTP Status Codes

  • 200 - Success
  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 404 - Not Found
  • 500 - Internal Server Error

Rate Limiting

  • Default Limit: 100 requests per minute per IP
  • Burst Limit: 200 requests per minute
  • Headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset