QRCode Generation API in Serverless World Using Kumologica
We will be creating a Kumologica API that will generate and host a QRCode — when read using a QRCode scanner will direct you to a simple floor access form.
Join the DZone community and get the full member experience.
Join For Free
The concepts of social distancing, contactless approach, and safety first have now become the new normal in our present COVID induced downturn.
We have already started adapting by finding new ways to interact with new technologies or by enhancing the existing ones. One such technology that is already popular and has made a comeback is the QRCode. During this COVID time, QRCode helps in ensuring social distancing and business operations go hand in hand.
QR Codes can easily be scanned from a short distance. QRCodes have a minimum radius of 25 cm (10 in), which then scales up depending on the size of the QR Code.
QR Codes are the perfect tool for use cases such as:
- Contactless mobile payments.
- Bitcoin and cryptocurrency payments.
- Convenient WiFi access.
- Contactless ticketing.
- Contactless entrance to buildings, offices, or events.
- General information sharing for social media links, PDFs, videos, images, and website links.
And the list goes…
In this article, we will be creating a Kumologica API that will generate and host a QRCode which when read using a QRCode scanner will direct you to a simple floor access form. Kumologica is a free low-code development tool to build serverless integrations. You can learn more about Kumologica in this medium article or subscribe to our YouTube channel for the latest videos.
Use Case
In this use case, an employee approaches the service desk for access to a floor. The service desk operator checks the employee id and generates a QR code which is displayed on a screen in front of the service desk operator.
The employee needs to scan the QRCode which will direct to the URL for a floor access form which needs to be completed by the employee and submitted to get the clearance.
Prerequisite
- Kumologica designer installed in your machine. https://kumologica.com/download.html
Implementation
- Open Kumologica Designer, click the Home button and choose to Create New Kumologica Project.
Enter the name (for example QRCodeDemo), select directory for the project, and switch Source into From Existing Flow …
2. Copy and Paste the following flow
3. press Create Button.
You should be seeing two flows as given below on the designer canvas.
The First Flow Is for Generating the QRCode
First Flow (QR Code generation API)
The Second Flow Is for Responding With the Access Form.
Second Flow (Access Form API)
When the code is imported the first flow will be having an empty node which is a missing QRCode node. QRCode node is not part of the core nodes and hence will not be showing up in the palette.
QR String : https://<<gatewayid>>.xyz.amazon.com/test/access
The URL provided as the QR string is the endpoint URL of the second flow.
Note: The second flow endpoint URL can be known only once the flow is deployed to your AWS account. After the first deployment updates the QR string in QRCode node with the second endpoint URL and redeploy. This is done because both the QRCode generation API and Access From API are in the same project.
Testing
- Invoke the First flow (QRCode generation API) endpoint URL on your browser to see the QRCode displayed.
2. Use your QRCode scanner on your mobile phone to scan the code.
3. Click on the second flow (Access From API) endpoint URL popped up to see the employee JSON data.
Conclusion
This article presented how easy Kumologica Designer to build an API to generate and host a QRCode. Remember Kumologica is free to download and use. Go ahead and give it a try, we would love to hear your feedback.
In the meantime, if there is any specific use case that you would like to see in a future article please let us know in the comments section.
Opinions expressed by DZone contributors are their own.
Trending
-
Operator Overloading in Java
-
Why I Prefer Trunk-Based Development
-
Building a Flask Web Application With Docker: A Step-by-Step Guide
-
Scaling Site Reliability Engineering (SRE) Teams the Right Way
Comments