File size: 7,537 Bytes
71cdd8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>API Documentation | XML Data Explorer</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
</head>
<body class="bg-gray-50 min-h-screen">
    <custom-header></custom-header>
    <main class="container mx-auto px-4 py-8">
        <div class="max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden p-8">
            <h1 class="text-3xl font-bold text-gray-900 mb-6">API Documentation</h1>
            
            <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
                <div class="lg:col-span-2">
                    <!-- Endpoints -->
                    <div class="space-y-6">
                        <!-- Upload Endpoint -->
                        <div class="bg-gray-50 border border-gray-200 rounded-lg p-6">
                            <div class="flex justify-between items-start">
                                <div>
                                    <h2 class="text-xl font-semibold text-gray-800 mb-2">Upload XML/Excel</h2>
                                    <div class="flex items-center gap-2 mb-4">
                                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">POST</span>
                                        <code class="text-sm bg-gray-100 px-2 py-1 rounded">/api/upload</code>
                                    </div>
                                </div>
                                <button class="copy-btn" data-clipboard-text="POST /api/upload">
                                    <i data-feather="copy" class="w-4 h-4"></i>
                                </button>
                            </div>
                            <p class="text-gray-600 mb-4">Upload an XML or Excel file for processing.</p>
                            
                            <h3 class="font-medium text-gray-700 mb-2">Request Body</h3>
                            <div class="bg-gray-800 rounded-lg p-4 mb-4 overflow-x-auto">
                                <pre class="text-gray-100 text-sm"><code>{
    "file": "File object (XML/XLSX/CSV)"
}</code></pre>
                            </div>

                            <h3 class="font-medium text-gray-700 mb-2">Success Response</h3>
                            <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto">
                                <pre class="text-gray-100 text-sm"><code>{
    "status": "success",
    "data": {
        "elements": 42,
        "levels": 3,
        "attributes": 15,
        "structure": "..."
    }
}</code></pre>
                            </div>
                        </div>

                        <!-- Export Endpoint -->
                        <div class="bg-gray-50 border border-gray-200 rounded-lg p-6">
                            <div class="flex justify-between items-start">
                                <div>
                                    <h2 class="text-xl font-semibold text-gray-800 mb-2">Export Data</h2>
                                    <div class="flex items-center gap-2 mb-4">
                                        <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">GET</span>
                                        <code class="text-sm bg-gray-100 px-2 py-1 rounded">/api/export/:format</code>
                                    </div>
                                </div>
                                <button class="copy-btn" data-clipboard-text="GET /api/export/:format">
                                    <i data-feather="copy" class="w-4 h-4"></i>
                                </button>
                            </div>
                            <p class="text-gray-600 mb-4">Export processed data in various formats.</p>
                            
                            <h3 class="font-medium text-gray-700 mb-2">URL Parameters</h3>
                            <div class="bg-gray-800 rounded-lg p-4 mb-4 overflow-x-auto">
                                <pre class="text-gray-100 text-sm"><code>{
    "format": "xlsx|csv|json|xml"
}</code></pre>
                            </div>

                            <h3 class="font-medium text-gray-700 mb-2">Success Response</h3>
                            <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto">
                                <pre class="text-gray-100 text-sm"><code>{
    Binary file of the requested format
}</code></pre>
                            </div>
                        </div>
                    </div>
                </div>

                <div>
                    <!-- Quick Start -->
                    <div class="bg-blue-50 border border-blue-200 rounded-lg p-6 mb-6">
                        <h2 class="text-xl font-semibold text-blue-800 mb-4">Quick Start</h2>
                        <div class="space-y-4">
                            <div>
                                <h3 class="font-medium text-blue-700 mb-1">Upload a file</h3>
                                <pre class="bg-blue-100 text-blue-800 p-2 rounded text-sm overflow-x-auto"><code>curl -X POST -F "file=@data.xml" https://api.example.com/upload</code></pre>
                                <button class="copy-btn mt-1" data-clipboard-text='curl -X POST -F "file=@data.xml" https://api.example.com/upload'>
                                    <i data-feather="copy" class="w-4 h-4"></i>
                                </button>
                            </div>

                            <div>
                                <h3 class="font-medium text-blue-700 mb-1">Export as JSON</h3>
                                <pre class="bg-blue-100 text-blue-800 p-2 rounded text-sm overflow-x-auto"><code>curl -o output.json https://api.example.com/export/json</code></pre>
                                <button class="copy-btn mt-1" data-clipboard-text='curl -o output.json https://api.example.com/export/json'>
                                    <i data-feather="copy" class="w-4 h-4"></i>
                                </button>
                            </div>
                        </div>
                    </div>

                    <!-- Authentication -->
                    <div class="bg-gray-50 border border-gray-200 rounded-lg p-6">
                        <h2 class="text-xl font-semibold text-gray-800 mb-4">Authentication</h2>
                        <p class="text-gray-600 mb-4">Our API uses API keys for authentication.</p>
                        <div class="bg-gray-800 rounded-lg p-4 mb-4 overflow-x-auto">
                            <pre class="text-gray-100 text-sm"><code>Authorization: Bearer your_api_key</code></pre>
                        </div>
                        <button class="copy-btn" data-clipboard-text="Authorization: Bearer your_api_key">
                            <i data-feather="copy" class="w-4 h-4"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </main>
    
    <custom-footer></custom-footer>
    <script src="components/header.js"></script>
    <script src="components/footer.js"></script>
    <script src="script.js"></script>
    <script>
        feather.replace();
    </script>
</body>
</html>