
QRCode Generator is a REST API designed to generate QRCode.
This API is able to deviler the QRCode as an Base64 encoded PNG or directly as an image url.
Use Docker
docker pull justinbriard/qrcode
You need to setup some Environment Variable to run QRCode Generator in order to use bucket management. /!\ QRCOde Generator didn't manage the S3 storage, if you don't clean the bucket, the generated image will stay forever. I personaly use a Life Cycle rule to delete all the image older than 2 days.
S3BUCKET_URL="https://s3.fr-par.scw.cloud"
ACCESS_KEY="SCW4KFF46W"
SECRET_KEY="1ff11952-fed1-4a94-95e7-83fdb9a66367"
S3BUCKET_NAME="otbm-qrcode"
S3BUCKET_REGION="fr-par"
URL="https://api.qrcode.otbm.fr"
Body Json
You need to send this body, if you omit any of the elements you will get an error.
{
"text":"hello World",
"size":"10",
"result_format":"base64"
}
You need to set this 3 elements :
text This is literraly the text you want to encode in the QRCode.
size It's the size of the generated image 1 is the smallest and 40 is the largest.
result_format Is the format is the format in which the image will be made available.
Endpoint v1/qrcode
Base64
curl --request POST \
--url http://[server]:[port]/v1/elements \
--header 'content-type: application/json' \
--data '{
"text":"hello World",
"size":"10",
"result_format":"base64"
}'
result:
{
"status": "ok",
"result": "iVBORw0KGgoAAAANSUhEUgAAAEIAAABCAQAAAADLLz1FAAAAoklEQVR4nK3SMQrEMAxEUYFbQ64imNYwVzekDfgqBrUCbcgmZJVto+pVHyEkcU6XlyRl8SlMogEWWQpZUZ7q81/D7CFaGVfvkhRAJSuCled+lyYw+mRSYzO3SBr7BqMySbkYPKsYZ5es6u7tqNzCdPSjcksrTZkFXVcpkRQBI7Kk2AZlEm2/d40kRWvfyq/qagsfgs6RRYttY9ZeGM2z3v2hD7edgzQjGFQ7AAAAAElFTkSuQmCC"
}
Link
curl --request POST \
--url http://[server]:[port]/v1/elements \
--header 'content-type: application/json' \
--data '{
"text":"hello World",
"size":"10",
"result_format":"link"
}'
result:
{
"status": "ok",
"result": "https://s3.fr-par.scw.cloud/otbm-qrcode/9KGB3KRG2MSCY6TY4L.png"
}
Endpoint /checkhealth
curl --request GET \
--url http://[server]:[port]/checkhealth
result:
{
"status": "ok"
}
Endpoint /version
curl --request GET \
--url http://[server]:[port]/version
result:
1.4
You can see more info on https://qrcode.otbm.fr/ or test the API https://api.qrcode.otbm.fr
Under development
Content type
Image
Digest
sha256:4c9c8aaf4…
Size
64.8 MB
Last updated
over 2 years ago
docker pull justinbriard/qrcode