Skip to content

Commit 41a23c3

Browse files
committed
Complete File Storage and CDP API documentations.
1 parent a5b62c6 commit 41a23c3

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

documentations/src/views/FileStorage.vue

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,82 @@
108108
</li>
109109
</ul>
110110

111+
<b class="mt-4 mb-2 d-block border-bottom fw-bold">Storage: File Download</b>
112+
<p>Generate a CDP-accessible ticket for a specified stored file on the server via assigned name. If successful, the file will be accessible on <span class="bg-secondary px-1 border d-inline">api/cdp.php?ticket=&lt;generated_ticket&gt;</span></p>
113+
<pre class="bg-secondary border-gray border rounded p-2">api/index.php?action=file_download</pre>
114+
115+
<p>Payload Structure:</p>
116+
<ul>
117+
<li><i>assigned_name</i> &mdash; The assigned name of the file for the ticket to be generated.</li>
118+
<li><i>expiring</i> &mdash; Boolean value to specify if the ticket will expire. (<i>0</i> for <i>false</i> and <i>1</i> for <i>true</i>)</li>
119+
</ul>
120+
121+
<pre class="bg-secondary border-gray border rounded p-2"><span class="text-primary">{</span>
122+
<span class="text-warning">"name"</span>: <span class="text-danger">"&lt;assigned_name&gt;"</span>,
123+
<span class="text-warning">"should_expire"</span>: <span class="text-danger">"&lt;expiring&gt;"</span>
124+
<span class="text-primary">}</span></pre>
125+
126+
<b>Response Data</b>
127+
<ul>
128+
<li><i>value</i> &mdash; The ticket string in UUID form for the CDP-accessible file.</li>
129+
</ul>
130+
131+
<b class="mt-4 mb-2 d-block border-bottom fw-bold">Storage: File Fetch All</b>
132+
<p>Fetch the assigned name, original file name, mime type, and the checksum of all the uploaded files.</p>
133+
<pre class="bg-secondary border-gray border rounded p-2">api/index.php?action=file_fetch_all</pre>
134+
135+
<b>Example Payload</b>
136+
<pre class="bg-secondary border-gray border rounded p-2"><span class="text-primary">{}</span></pre>
137+
138+
<b>Response Data</b>
139+
<ul>
140+
<li>
141+
<i>value</i> &mdash; This key will contain a 2D array of all the fetched file information
142+
<table class="table table-hover">
143+
<tr>
144+
<th>Array Index</th>
145+
<th>Index Content</th>
146+
</tr>
147+
<tr>
148+
<td>0</td>
149+
<td>Assigned file name for the fetched file</td>
150+
</tr>
151+
<tr>
152+
<td>1</td>
153+
<td>Original file name when it was uploaded</td>
154+
</tr>
155+
<tr>
156+
<td>2</td>
157+
<td>File mime type of the fetched file</td>
158+
</tr>
159+
<tr>
160+
<td>3</td>
161+
<td>Checksum of the fetched file in MD5 hash</td>
162+
</tr>
163+
</table>
164+
</li>
165+
</ul>
166+
167+
<b class="mt-4 mb-2 d-block border-bottom fw-bold">CDP: Expire All</b>
168+
<p>Expire all the tickets generated for the CDP (Content Delivery Page). This action will revoke all the generated tickets including the no expiration tickets.</p>
169+
<pre class="bg-secondary border-gray border rounded p-2">api/index.php?action=cdp_expire_all</pre>
170+
171+
<b>Example Payload</b>
172+
<pre class="bg-secondary border-gray border rounded p-2"><span class="text-primary">{}</span></pre>
173+
174+
<b class="mt-4 mb-2 d-block border-bottom fw-bold">CDP: Expire Ticket</b>
175+
<p>Revoke a specified generated ticket for the CDP (Content Delivery Page).</p>
176+
<pre class="bg-secondary border-gray border rounded p-2">api/index.php?action=cdp_expire_ticket</pre>
177+
178+
<p>Payload Structure:</p>
179+
<ul>
180+
<li><i>id</i> &mdash; The generated ticket to be revoked.</li>
181+
</ul>
182+
183+
<pre class="bg-secondary border-gray border rounded p-2"><span class="text-primary">{</span>
184+
<span class="text-warning">"ticket"</span>: <span class="text-danger">"&lt;id&gt;"</span>
185+
<span class="text-primary">}</span></pre>
186+
111187
<div class="row">
112188
<div class="col-6">
113189
<RouterLink to="/database" class="btn btn-primary">

0 commit comments

Comments
 (0)