barcodes/templates/help.html

42 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>API Documentation</title>
</head>
<body>
<h1>API Requests</h1>
<p>API Requests can be made by making a POST request to /generate</p>
<p>The request body should be JSON similar to the below</p>
<pre>
<code>
{
"barcode_type": "code128",
"width": 600,
"height": 100,
"ecc_level": 4,
"content": "45684562"
}
</code>
</pre>
<p><code>barcode_type</code> should be one of:</p>
<ul>
{{range .BarcodeOptions}}
<li>{{.}}</li>
{{end}}
</ul>
<p><code>width</code> and <code>height</code> are in pixels - PDF417 is a fixed size and these options will only change the canvas size.</p>
<p><code>ecc_level</code> should be 1, 2, 3 or 4 where 1 is least resilient and 4 is most resilient</p>
<p><code>content</code> should be the value you wish the barcode to display. This should be a string and may not accept all characters - that is dependent on the barcode type.</p>
<p>The response will be a PNG image</p>
</body>
</html>