-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.html
More file actions
181 lines (159 loc) · 6.03 KB
/
common.html
File metadata and controls
181 lines (159 loc) · 6.03 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Common Query Parameters - Circuit Auction API</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" rel="stylesheet" />
<style>
body { padding-top: 70px; background-color: #f8f9fa; }
.navbar-brand { font-weight: bold; }
.main-content { padding: 2rem; }
pre { background: #f4f4f4; padding: 1rem; border-radius: 0.375rem; position: relative; }
.copy-btn { position: absolute; top: 0.5rem; right: 0.5rem; font-size: 0.8rem; }
.endpoint { font-family: 'Courier New', monospace; background: #e9ecef; padding: 0.2rem 0.4rem; border-radius: 0.25rem; }
.param-table th { background-color: #f8f9fa; }
</style>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">Circuit Auction API v1.0</a>
</div>
</nav>
<div class="container main-content">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">API</a></li>
<li class="breadcrumb-item active" aria-current="page">Common Query Parameters</li>
</ol>
</nav>
<h1>Common Query Parameters</h1>
<p class="lead">Query parameters used across multiple API endpoints.</p>
<!-- Pagination -->
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">Pagination</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-sm param-table">
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>range</code></td>
<td>integer</td>
<td>25</td>
<td>Items per page</td>
</tr>
<tr>
<td><code>page</code></td>
<td>integer</td>
<td>0</td>
<td>Page number (0-indexed)</td>
</tr>
</tbody>
</table>
</div>
<h5 class="mt-3">Example</h5>
<pre><code class="language-bash">?range=25&page=2</code></pre>
</div>
</div>
<!-- Sorting -->
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">Sorting</h4>
</div>
<div class="card-body">
<p>Use the <code>sort</code> parameter to order results by one or more fields.</p>
<h5>Syntax</h5>
<ul>
<li>Ascending: <code>?sort=field_name</code></li>
<li>Descending: <code>?sort=-field_name</code></li>
<li>Multiple fields: <code>?sort=-created,id</code></li>
</ul>
<h5 class="mt-3">Examples</h5>
<pre><code class="language-bash"># Sort by ID ascending
?sort=id
# Sort by created date descending
?sort=-created
# Multiple sort fields
?sort=-created,id</code></pre>
</div>
</div>
<!-- Filtering -->
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">Filtering</h4>
</div>
<div class="card-body">
<h5>Simple Filter</h5>
<p>Filter by exact value match:</p>
<pre><code class="language-bash">?filter[field_name]=value</code></pre>
<h5 class="mt-4">IN Operator (Multiple Values)</h5>
<p>Filter by multiple possible values:</p>
<pre><code class="language-bash">?filter[field_name][value][0]=value1&filter[field_name][value][1]=value2&filter[field_name][operator]=IN</code></pre>
<h5 class="mt-4">Range Filter</h5>
<p>Filter by numeric or date range:</p>
<pre><code class="language-bash"># Numeric range
?filter[field_name][value][from]=100&filter[field_name][value][to]=1000
# Date range
?filter[created][value][from]=2025-01-01&filter[created][value][to]=2025-12-31</code></pre>
<h5 class="mt-4">Regex Search</h5>
<p>Filter using regular expressions:</p>
<pre><code class="language-bash">?filter[field_name][value]=search.*term&filter[field_name][operator]=REGEXP</code></pre>
</div>
</div>
<!-- Field Selection -->
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">Field Selection</h4>
</div>
<div class="card-body">
<p>Request only specific fields to reduce payload size:</p>
<pre><code class="language-bash">?fields=id,label,status,created</code></pre>
<h5 class="mt-3">Example</h5>
<pre><code class="language-bash">GET /api/v1.0/datatable-clients?fields=id,first_name,last_name,email</code></pre>
</div>
</div>
<!-- Global Search -->
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">Global Search</h4>
</div>
<div class="card-body">
<p>Search across multiple fields at once:</p>
<pre><code class="language-bash">?global_search=search+term</code></pre>
<h5 class="mt-3">Example</h5>
<pre><code class="language-bash">GET /api/v1.0/datatable-clients?global_search=john</code></pre>
</div>
</div>
</div>
<script src="assets/js/sidebar.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script>
document.querySelectorAll('pre code').forEach(block => {
const button = document.createElement('button');
button.className = 'btn btn-sm btn-outline-secondary copy-btn';
button.textContent = 'Copy';
button.onclick = () => {
navigator.clipboard.writeText(block.textContent);
button.textContent = 'Copied!';
setTimeout(() => button.textContent = 'Copy', 2000);
};
block.parentElement.appendChild(button);
});
</script>
</body>
</html>