Files
fnx_web/res/template/apidoc.html

93 lines
3.1 KiB
HTML

{{define "apidoc"}}<!DOCTYPE html>
<html>
<head>
{{template "meta_tags" "API Documentation"}}
{{template "user_style" .}}
<style>
.api_doc_details{
border-top: 1px solid;
border-bottom: 1px solid;
margin: 15px -8px 15px -8px;
}
.api_doc_details > summary {
padding: 2px;
font-family: monospace;
}
.api_doc_details > summary > .method {
display: inline-block;
width: 80px;
}
.api_doc_details > div {
padding: 8px;
}
.api_doc_details.request_get{ border-color: #3636ff; background-color: rgba(32, 32, 255, 0.2);} /* GET requests */
.api_doc_details.request_post{ border-color: #00d000; background-color: rgba(0, 255, 0, 0.05);} /* POST requests */
.api_doc_details.request_delete{border-color: #B00000; background-color: rgba(255, 0, 0, 0.05);} /* DELETE requests */
.api_doc_details.request_put{ border-color: #B06000; background-color: rgba(255, 128, 0, 0.05);} /* PUT requests */
.api_doc_details.request_patch{ border-color: #6000B0; background-color: rgba(128, 0, 255, 0.1);} /* PATCH requests */
</style>
</head>
<body>
<div id='body' class="body">
{{template "menu" .}}
<h1>Pixeldrain API Documentation</h1>
<p>
Welcome to the Pixeldrain API documentation.
<br/>
The methods for uploading and retrieving files don't require an
API key. The methods for creating and retrieving lists also
don't require an API key. All methods which delete or modify a
resource <strong>do</strong> require an API key.
<br/>
API keys can be obtained from the login API.
</p>
<p>
Some JSON responses include fields which end in "_href" (some
people don't know this, but "href" stands for "Hypertext
Reference", the more you know). These point to different places
in the API, which you can retrieve with a GET request. The path
is to be appended to the API URL, so "/file/someid/thumbnail"
becomes "{{apiUrl}}/file/someid/thumbnail".
</p>
<p>
The base URL for the API is "{{apiUrl}}", all paths below are
relative to that URL.
</p>
<h2>Form value order</h2>
<p>
I recommend you put files at the end of every file upload form.
By doing this the pixeldrain server can respond to malformed
requests before the file upload finishes and this may save you a
lot of time and bandwidth when uploading large files. Make sure
your HTTP client has support for premature responses, pixeldrain
uses them a lot. If the server responds before your request is
finished it will always indicate an error and you may abort the
connection.
</p>
<h2>File Methods</h2>
{{template "api-file-post"}}
{{template "api-file-id-get"}}
{{template "api-file-id-info-get"}}
{{template "api-file-id-thumbnail-get"}}
{{/*template "api-file-id-delete"*/}}
<h2>List Methods</h2>
{{template "api-list-post"}}
{{template "api-list-get"}}
<!--<h2>Filesystem Methods</h2>-->
{{/*template "api-filesystem-path-post"*/}}
{{/*template "api-filesystem-path-get"*/}}
{{/*template "api-filesystem-path-delete"*/}}
{{template "footer"}}
</div>
{{template "analytics"}}
</body>
</html>
{{end}}