Clean Swagger UI and add CORS warning alert
- Removed lengthy documentation text from Swagger API page - Added prominent CORS error explanation to General Documentation - Users now understand "Try it out" failures are normal browser behavior - Provided alternative testing methods (cURL, Postman, code examples)
This commit is contained in:
+16
@@ -497,6 +497,22 @@
|
||||
<strong>Note:</strong> This documentation is for XUI.ONE v1.5.13+. Replace placeholder values with your actual credentials.
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info" style="border-left-color: #e67e22;">
|
||||
<span class="alert-icon">⚠️</span>
|
||||
<strong>CORS Notice - "Try it out" Feature:</strong> When testing API endpoints directly in Swagger UI using the "Try it out" button, you may encounter a <code class="code-inline">Failed to fetch</code> error. This is <strong>NORMAL and EXPECTED</strong> browser behavior due to CORS (Cross-Origin Resource Security) policy.
|
||||
<br><br>
|
||||
<strong>Why this happens:</strong> Your browser blocks requests from this documentation site (GitHub Pages) to your XUI.ONE server for security reasons.
|
||||
<br><br>
|
||||
<strong>Solutions for testing:</strong>
|
||||
<ul class="list-styled" style="margin-top: 0.5rem;">
|
||||
<li>✅ Use cURL commands (copy from Swagger UI examples)</li>
|
||||
<li>✅ Use Postman, Insomnia, or similar API tools</li>
|
||||
<li>✅ Use the code examples (Python, PHP, JavaScript)</li>
|
||||
<li>⚙️ Temporarily enable CORS on your server (not recommended for production)</li>
|
||||
</ul>
|
||||
<strong>Important:</strong> This CORS error does NOT mean the documentation or API is broken. It's a browser security feature protecting your server.
|
||||
</div>
|
||||
|
||||
<h2 class="docs-title">XUI.ONE Admin API Documentation</h2>
|
||||
<p class="docs-subtitle">Comprehensive API documentation for XUI.ONE IPTV Panel Administration</p>
|
||||
|
||||
|
||||
+1
-102
@@ -1,108 +1,7 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: XUI.ONE Admin API
|
||||
description: |
|
||||
**Comprehensive API documentation for XUI.ONE IPTV Panel Administration**
|
||||
|
||||
### 🎯 Quick Start
|
||||
|
||||
This API provides programmatic access to manage your IPTV platform with 180+ endpoints for:
|
||||
- 📺 Manage subscriptions (Lines, MAG, Enigma2 devices)
|
||||
- 🎬 Control streams, channels, movies, and series
|
||||
- 📊 Monitor connections and activity logs
|
||||
- ⚙️ Configure servers and load balancers
|
||||
|
||||
---
|
||||
|
||||
### 🔗 Base URL Pattern
|
||||
|
||||
```
|
||||
{protocol}://YOUR_SERVER:{port}/<Access-Code>/?api_key=<API-KEY>&action=ACTION
|
||||
```
|
||||
|
||||
**Customize:**
|
||||
- `{protocol}` → http or https
|
||||
- `YOUR_SERVER` → Your server domain/IP (e.g., 192.168.1.100)
|
||||
- `{port}` → Your port (80, 8000, 9000, or custom)
|
||||
- `<Access-Code>` → Your access code (e.g., `cSbuFLhp`)
|
||||
- `<API-KEY>` → Your API key
|
||||
- `ACTION` → API action name (e.g., `get_lines`)
|
||||
|
||||
**Common Ports:**
|
||||
- `80` - HTTP (default)
|
||||
- `8000` - HTTP (alternative)
|
||||
- `9000` - HTTPS (recommended)
|
||||
- Custom - Any port you configured
|
||||
|
||||
---
|
||||
|
||||
### 🔐 Authentication Setup
|
||||
|
||||
**Required:**
|
||||
1. XUI.ONE panel installed (v1.5.5+)
|
||||
2. Admin API access code created
|
||||
3. API key generated from profile
|
||||
|
||||
**Quick Setup:**
|
||||
1. Panel → Management → Access Control → Access Codes
|
||||
2. Create "Admin API" access code
|
||||
3. Profile → Generate API Key
|
||||
4. Test: `curl "http://your-server.com/<Access-Code>/?api_key=<API-KEY>&action=user_info"`
|
||||
|
||||
📖 **[View detailed setup guide →](https://github.com/worldofiptvcom/xui-one-api-docs/blob/main/docs/getting-started.md)**
|
||||
|
||||
---
|
||||
|
||||
### 📝 Request Methods
|
||||
|
||||
**GET** - Query data
|
||||
```
|
||||
/?api_key=<API-KEY>&action=get_lines
|
||||
```
|
||||
|
||||
**POST** - Create/update data
|
||||
```
|
||||
curl -X POST ".../?api_key=<API-KEY>&action=create_line" -d "username=test"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### ✅ Response Format
|
||||
|
||||
**Success:**
|
||||
```json
|
||||
{
|
||||
"status": "STATUS_SUCCESS",
|
||||
"data": { ... }
|
||||
}
|
||||
```
|
||||
|
||||
**Error:**
|
||||
```json
|
||||
{
|
||||
"status": "STATUS_FAILURE",
|
||||
"error": "Error description"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🔒 Security Best Practices
|
||||
|
||||
- ✅ Use HTTPS (port 9000) in production
|
||||
- ✅ Whitelist IPs in access code settings
|
||||
- ✅ Rotate API keys regularly
|
||||
- ✅ Never commit keys to version control
|
||||
|
||||
---
|
||||
|
||||
### 📚 Resources
|
||||
|
||||
- **GitHub:** [Documentation Repository](https://github.com/worldofiptvcom/xui-one-api-docs)
|
||||
- **Community:** [World of IPTV Forums](https://www.worldofiptv.com)
|
||||
- **Getting Started:** [Setup Guide](https://github.com/worldofiptvcom/xui-one-api-docs/blob/main/docs/getting-started.md)
|
||||
- **XUI.ONE:** [Official Website](https://xui.one)
|
||||
|
||||
description: Comprehensive API documentation for XUI.ONE IPTV Panel Administration
|
||||
version: 1.5.13
|
||||
contact:
|
||||
name: XUI.ONE API Support
|
||||
|
||||
Reference in New Issue
Block a user